Re: [linux-audio-dev] pthread_mutex_unlock

From: Jens M Andreasen <jens.andreasen@email-addr-hidden>
Date: Thu Jan 26 2006 - 12:52:17 EET

Lee! Forget my other post ...

On Wed, 2006-01-25 at 22:27 -0500, Paul Coccoli wrote:

> In "Programming with POSIX Threads" by David R. Butenhof,
> pthread_mutex_unlock is said to do this:
>
> "Unlock a mutex. The mutex becomes unowned. If any threads are
> waiting for the mutex, one is awakened..."
>

Yes, but what is the completion of that sentence? Could it be:

... and placed in the ready state.

Or perhaps:

... in priority order to aquire the lock.

> Seems to suggest a reschedule. Butenhof worked on the POSIX
> standards, so I would consider him an authority.

There seems to be consensus among Solaris/HPUX/DEC/Linux implementations
that the thread is only awake long enough to aquire the lock. And then a
rescheduling *may* take place.

The posix documentation is a bit vague though.

-- 
Received on Thu Jan 26 16:15:07 2006

This archive was generated by hypermail 2.1.8 : Thu Jan 26 2006 - 16:15:07 EET