Subject: Re: posix semaphores and libpthread
To: Anthony Mallet <anthony.mallet@useless-ficus.net>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: current-users
Date: 02/02/2003 21:36:37
Since you are using nonshared semaphore and sem_wait(), how'd
you ever get wakeup from the call?

I assume that the semaphore is nonshared by seeing that
you hit the preempt condition, which is only hit for USEM_USER
semaphores. USEM_USER is set when sem_init() is called
with pshared == 0, so I'm assuming you do just that. If you
expect the semaphore to be posted from other process, you
ought to sem_init() it with pshared == 1 ...

Jaromir

Anthony Mallet wrote:
> I still have some trouble with posix semaphores in libpthread.
> Calling sem_wait when no thread has been created triggers this:
> 
> assertion "next != 0" failed: file "/home/src/netbsd-current/lib/libpthread/pthread_run.c", line 118, function "pthread__next"
> 
> Shoud I send-pr?
> Or am I wrong in trying do to this?
> Or is it a known issue :) ?
> 


-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.org/
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-