Lines Matching refs:swp
84 rfs4_sw_init(rfs4_state_wait_t *swp)
86 mutex_init(swp->sw_cv_lock, NULL, MUTEX_DEFAULT, NULL);
87 cv_init(swp->sw_cv, NULL, CV_DEFAULT, NULL);
88 swp->sw_active = FALSE;
89 swp->sw_wait_count = 0;
93 rfs4_sw_destroy(rfs4_state_wait_t *swp)
95 mutex_destroy(swp->sw_cv_lock);
96 cv_destroy(swp->sw_cv);
100 rfs4_sw_enter(rfs4_state_wait_t *swp)
102 mutex_enter(swp->sw_cv_lock);
103 while (swp->sw_active) {
104 swp->sw_wait_count++;
105 cv_wait(swp->sw_cv, swp->sw_cv_lock);
106 swp->sw_wait_count--;
108 ASSERT(swp->sw_active == FALSE);
109 swp->sw_active = TRUE;
110 mutex_exit(swp->sw_cv_lock);
114 rfs4_sw_exit(rfs4_state_wait_t *swp)
116 mutex_enter(swp->sw_cv_lock);
117 ASSERT(swp->sw_active == TRUE);
118 swp->sw_active = FALSE;
119 if (swp->sw_wait_count != 0)
120 cv_broadcast(swp->sw_cv);
121 mutex_exit(swp->sw_cv_lock);