Lines Matching defs:waiter
328 * Parameters: waiter(I) - control data structure
357 hook_wait_setflag(flagwait_t *waiter, uint32_t busyset, fwflag_t wanted,
363 mutex_enter(&waiter->fw_lock);
364 if (waiter->fw_flags & FWF_DESTROY) {
365 cv_signal(&waiter->fw_cv);
366 mutex_exit(&waiter->fw_lock);
369 while (waiter->fw_flags & busyset) {
370 wantedset = ((waiter->fw_flags & wanted) == wanted);
372 waiter->fw_flags |= wanted;
373 CVW_EXIT_WRITE(waiter->fw_owner);
374 cv_wait(&waiter->fw_cv, &waiter->fw_lock);
380 mutex_exit(&waiter->fw_lock);
382 CVW_ENTER_WRITE(waiter->fw_owner);
383 mutex_enter(&waiter->fw_lock);
385 waiter->fw_flags &= ~wanted;
386 if (waiter->fw_flags & FWF_DESTROY) {
387 cv_signal(&waiter->fw_cv);
388 mutex_exit(&waiter->fw_lock);
392 waiter->fw_flags &= ~wanted;
393 ASSERT((waiter->fw_flags & wanted) == 0);
394 ASSERT((waiter->fw_flags & newflag) == 0);
395 waiter->fw_flags |= newflag;
396 mutex_exit(&waiter->fw_lock);
403 * Parameters: waiter(I) - control data structure
410 hook_wait_unsetflag(flagwait_t *waiter, fwflag_t oldflag)
412 mutex_enter(&waiter->fw_lock);
413 waiter->fw_flags &= ~oldflag;
414 cv_signal(&waiter->fw_cv);
415 mutex_exit(&waiter->fw_lock);
421 * Parameters: waiter(I) - control data structure
430 hook_wait_destroy(flagwait_t *waiter)
432 ASSERT((waiter->fw_flags & FWF_DESTROY_WANTED) == 0);
433 mutex_enter(&waiter->fw_lock);
434 if (waiter->fw_flags & FWF_DESTROY_WANTED) {
435 cv_signal(&waiter->fw_cv);
436 mutex_exit(&waiter->fw_lock);
439 waiter->fw_flags |= FWF_DESTROY_WANTED;
440 while (!FWF_DESTROY_OK(waiter)) {
441 CVW_EXIT_WRITE(waiter->fw_owner);
442 cv_wait(&waiter->fw_cv, &waiter->fw_lock);
443 CVW_ENTER_WRITE(waiter->fw_owner);
446 * There should now be nothing else using "waiter" or its
450 waiter->fw_flags = FWF_DESTROY_ACTIVE;
451 cv_signal(&waiter->fw_cv);
452 mutex_exit(&waiter->fw_lock);
460 * Parameters: waiter(I) - control data structure
462 * waiter uses
469 hook_wait_init(flagwait_t *waiter, cvwaitlock_t *owner)
471 cv_init(&waiter->fw_cv, NULL, CV_DRIVER, NULL);
472 mutex_init(&waiter->fw_lock, NULL, MUTEX_DRIVER, NULL);
473 waiter->fw_flags = FWF_NONE;
474 waiter->fw_owner = owner;