All of lore.kernel.org
 help / color / mirror / Atom feed
* Breaking out of pthread_mutex_lock
@ 2008-05-29 23:41 Darren Hart
  2008-05-29 23:46 ` Stephen Hemminger
  2008-05-30  8:58 ` Gilles Carry
  0 siblings, 2 replies; 6+ messages in thread
From: Darren Hart @ 2008-05-29 23:41 UTC (permalink / raw)
  To: RT

I find I need to be able to break out of the blocked state while waiting
to acquire a pthread_mutex.  I'm using PI mutexes and want to continue
to do so.  As I understand it, I can't use a signal to break out of the
lock as the man pages states:

"If a signal is delivered to a thread waiting for a mutex,  upon  return
from  the  signal handler the thread shall resume waiting for the mutex
as if it was not interrupted."

and that pthread_mutex_lock will not return EINTR.  I had considered
using cond variables, but I don't think they will provide the same PI
behavior (since the threads are not blocked on the mutex while awaiting
the pthread_cond_signal - right?).

I'm sure I'm not the first to want to do this, does anyone know of a
common best practice for accomplishing such a thing?

-- 
Darren Hart
Real-Time Linux Team
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-06-02 11:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-29 23:41 Breaking out of pthread_mutex_lock Darren Hart
2008-05-29 23:46 ` Stephen Hemminger
2008-05-30 14:57   ` Darren Hart
2008-05-30 15:24     ` Clark Williams
2008-06-02 11:36       ` Gilles Carry
2008-05-30  8:58 ` Gilles Carry

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.