Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*

*** 1150,1160 **** { fcoe_worker_t *w = (fcoe_worker_t *)arg; fcoe_i_frame_t *fmi; int ret; ! atomic_add_32(&fcoe_nworkers_running, 1); mutex_enter(&w->worker_lock); w->worker_flags |= FCOE_WORKER_STARTED | FCOE_WORKER_ACTIVE; while ((w->worker_flags & FCOE_WORKER_TERMINATE) == 0) { /* * loop through the frames --- 1150,1160 ---- { fcoe_worker_t *w = (fcoe_worker_t *)arg; fcoe_i_frame_t *fmi; int ret; ! atomic_inc_32(&fcoe_nworkers_running); mutex_enter(&w->worker_lock); w->worker_flags |= FCOE_WORKER_STARTED | FCOE_WORKER_ACTIVE; while ((w->worker_flags & FCOE_WORKER_TERMINATE) == 0) { /* * loop through the frames
*** 1179,1189 **** cv_wait(&w->worker_cv, &w->worker_lock); w->worker_flags |= FCOE_WORKER_ACTIVE; } w->worker_flags &= ~(FCOE_WORKER_STARTED | FCOE_WORKER_ACTIVE); mutex_exit(&w->worker_lock); ! atomic_add_32(&fcoe_nworkers_running, -1); list_destroy(&w->worker_frm_list); } void fcoe_post_frame(fcoe_frame_t *frm) --- 1179,1189 ---- cv_wait(&w->worker_cv, &w->worker_lock); w->worker_flags |= FCOE_WORKER_ACTIVE; } w->worker_flags &= ~(FCOE_WORKER_STARTED | FCOE_WORKER_ACTIVE); mutex_exit(&w->worker_lock); ! atomic_dec_32(&fcoe_nworkers_running); list_destroy(&w->worker_frm_list); } void fcoe_post_frame(fcoe_frame_t *frm)