168 |
reference for the client entry. */ |
reference for the client entry. */ |
169 |
|
|
170 |
pthread_mutex_lock (&client->lock); |
pthread_mutex_lock (&client->lock); |
171 |
while (!err && client->state != _HURD_CAP_STATE_GREEN) |
/* First, we have to check if the class is inhibited, and if it is, |
172 |
|
we have to wait until it is uninhibited. */ |
173 |
|
if (client->state == _HURD_CAP_STATE_BLACK) |
174 |
|
err = ECAP_NOREPLY; |
175 |
|
else if (client->state != _HURD_CAP_STATE_GREEN) |
176 |
{ |
{ |
177 |
if (client->state == _HURD_CAP_STATE_BLACK) |
pthread_mutex_unlock (&client->lock); |
178 |
err = ECAP_NOREPLY; |
pthread_mutex_lock (&bucket->client_cond_lock); |
179 |
else |
pthread_mutex_lock (&client->lock); |
180 |
err = hurd_cond_wait (&bucket->cond, &bucket->lock); |
while (!err && client->state != _HURD_CAP_STATE_GREEN) |
181 |
|
{ |
182 |
|
if (client->state == _HURD_CAP_STATE_BLACK) |
183 |
|
err = ECAP_NOREPLY; |
184 |
|
else |
185 |
|
{ |
186 |
|
pthread_mutex_unlock (&client->lock); |
187 |
|
err = hurd_cond_wait (&bucket->client_cond, |
188 |
|
&bucket->client_cond_lock); |
189 |
|
pthread_mutex_lock (&client->lock); |
190 |
|
} |
191 |
|
} |
192 |
|
pthread_mutex_unlock (&bucket->client_cond_lock); |
193 |
} |
} |
194 |
if (err) |
if (err) |
195 |
{ |
{ |