Lines Matching defs:hi
43 ilb_handle_impl_t *hi = (ilb_handle_impl_t *)h;
47 hi->h_valid = B_FALSE;
48 hi->h_error = err;
54 ilb_handle_impl_t *hi = NULL;
63 hi = calloc(sizeof (*hi), 1);
64 if (hi == NULL)
67 if (cond_init(&hi->h_cv, USYNC_THREAD, NULL) != 0) {
72 if (mutex_init(&hi->h_lock, USYNC_THREAD | LOCK_ERRORCHECK, NULL)
78 hi->h_busy = B_FALSE;
102 hi->h_socket = s;
103 hi->h_valid = B_TRUE;
110 *hp = (ilb_handle_t)hi;
112 free(hi);
121 ilb_handle_impl_t *hi = (ilb_handle_impl_t *)h;
126 if (mutex_lock(&hi->h_lock) != 0)
130 if (hi->h_closing) {
133 hi->h_closing = B_TRUE;
134 hi->h_error = ILB_STATUS_HANDLE_CLOSING;
138 while (hi->h_waiter > 0) {
139 if (cond_wait(&hi->h_cv, &hi->h_lock) != 0) {
140 (void) mutex_unlock(&hi->h_lock);
146 (void) close(hi->h_socket);
147 (void) mutex_destroy(&hi->h_lock);
148 (void) cond_destroy(&hi->h_cv);
149 free(hi);
173 ilb_handle_impl_t *hi = (ilb_handle_impl_t *)h;
179 if (mutex_lock(&hi->h_lock) != 0)
182 hi->h_waiter++;
183 while (hi->h_busy) {
184 if (cond_wait(&hi->h_cv, &hi->h_lock) != 0) {
185 hi->h_waiter--;
186 (void) cond_signal(&hi->h_cv);
187 (void) mutex_unlock(&hi->h_lock);
192 if (!hi->h_valid || hi->h_closing) {
193 hi->h_waiter--;
194 (void) cond_signal(&hi->h_cv);
195 (void) mutex_unlock(&hi->h_lock);
196 return (hi->h_error);
199 hi->h_busy = B_TRUE;
200 (void) mutex_unlock(&hi->h_lock);
202 s = hi->h_socket;
222 (void) mutex_lock(&hi->h_lock);
223 hi->h_busy = B_FALSE;
224 hi->h_waiter--;
225 (void) cond_signal(&hi->h_cv);
226 (void) mutex_unlock(&hi->h_lock);