73 |
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &canceltype); |
pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &canceltype); |
74 |
|
|
75 |
if (abstime) |
if (abstime) |
76 |
err = __pthread_timedblock (self, abstime); |
{ |
77 |
|
error_t err; |
78 |
|
|
79 |
|
err = __pthread_timedblock (self, abstime); |
80 |
|
if (err) |
81 |
|
/* We timed out. We may need to disconnect ourself from the |
82 |
|
waiter queue. |
83 |
|
|
84 |
|
FIXME: What do we do if we get a wakeup message before we |
85 |
|
disconnect ourself? It may remain until the next time we |
86 |
|
block. */ |
87 |
|
{ |
88 |
|
assert (err == ETIMEDOUT); |
89 |
|
|
90 |
|
__pthread_spin_lock (&mutex->__lock); |
91 |
|
if (self->prevp) |
92 |
|
__pthread_dequeue (self); |
93 |
|
__pthread_spin_unlock (&mutex->__lock); |
94 |
|
|
95 |
|
return err; |
96 |
|
} |
97 |
|
} |
98 |
else |
else |
99 |
{ |
{ |
100 |
err = 0; |
err = 0; |