Per Jessen wrote:
Per Jessen wrote:
The queue manipulation is key, the mux is uninteresting. The reason I am looking at this is that a thread got hung up (over the weekend) - in the core dump, a signal handler was called and tried to write to the queue whilst someone was reading from the queue. It's possible that is why I had to move to using semaphores - I wonder if pthread_mutex_lock is async-safe.
I think that has to be the reasoning - pthread_mutex_lock/-unlock are not safe to call from a signal handler, whereas sem_wait/-post are. I'll have to double check.
ah, well. sem_wait() isn't safe to call either, only sem_post(). Should have been obvious, duh. -- Per Jessen, Zürich (21.4°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-programming+owner@opensuse.org