Berkeley DB infinite sleep on Solaris [#3245]

David Schwartz davids at webmaster.com
Tue Jan 9 23:40:47 UTC 2001



> The problem is when the mutex is unlocked inside _lwp_cond_wait and
> the then sleeps - there's no locking around this, so another thread
> can get in lock the mutex, change the state of the condition variable,
> unlock & signal before we go to sleep in cond_wait.
> 
> With pthread semantics I agree, it guarantees that you can hold or not
> hold the mutex, with Solaris lwp this appears not to be true.
> 
> -- 
> Alex Kiernan, Principal Engineer, Development, Thus PLC

	The man page for _lwp_cond_wait says:

      The _lwp_cond_wait() function atomically  releases  the  LWP
     mutex  pointed  to by mp and causes the calling LWP to block
     on the LWP condition variable pointed to by cvp. The blocked
     LWP     may     be    awakened    by    _lwp_cond_signal(2),
     _lwp_cond_broadcast(2), or when interrupted by delivery of a
     signal.  Any  change in value of a condition associated with
     the condition variable cannot be inferred by the  return  of
     _lwp_cond_wait()   and   any  such  condition  must  be  re-
     evaluated.

	DS




More information about the inn-workers mailing list