> Note that I was initially signaling the condition variable from within the 
> signal handler but this did not work either. However, looking at pthread 
> documentation this is supposedly not supported: 
> https://linux.die.net/man/3/pthread_cond_signal
> (I'm not sure if that really applies to NuttX though).
> 

BTW, looking at the spec for pthread_cond_wait, there's actually no mention 
about a limitation regarding using pthread_cond_signal invoked from within a 
signal handler to unblock a pthread_cond_wait. However, this does not work
either for me. If you follow the signal operation, I can see that when it 
reaches the nxsem_get_value() on the cond->sem, the semaphore value is zero and 
the sem_give is not done.

Should this work?

Best,
Matia

Reply via email to