[OpenAFS-devel] afs_osi_Sleep and afs_osi_Wakeup on Linux
chas williams
chas@cmf.nrl.navy.mil
Tue, 04 Jun 2002 15:14:49 -0400
In message <OFC1602E42.3EC66AAB-ON85256BCE.00630636@in.ibm.com>,"Srikanth Vishw
anathan" writes:
>If afs_getevent() returns NULL, sleep will return prematurely. But this
>is no different from a spurious wakeup. The caller makes sure that sleep
>is called in a "while(condition not satisfied) sleep" loop that takes
>care of this.
the while() does handle the condition for a spurious wakeup. i believe
all the parts have been found in the afs code that dont loop but you
never know.
however, it probably is still not a good idea to drop the GLOCK during
afs_addevent(). since your previous race was related to GLOCK's being
droppped too soon, it would probably be best if afs_addevent/afs_getevent
didnt drop the GLOCK. if you keep afs_getevent from dropping the lock
there is no reason that afs_getevent and afs_addevent cant be merged back
together.