From: Igmar P. <mai...@jd...> - 2003-05-31 10:04:19
|
On Fri, 29 May 2003, Jeremy Fitzhardinge wrote: > On Thu, 2003-05-29 at 16:23, Andraz Tori wrote: > > > Maybe worth mentioning is, that thread 25 wasn't the thread that created > > & locked the mutex at the first place, but this should not be an issue, > > since this is vaild behaviour in pthreads. > > No it isn't. You can't lock with one thread and unlock with another - > pthread_mutex_unlock should return EPERM (calling thread does not own > mutex). With a big if attached : The mutex should be created as a checking mutex. If you don't, things just hang / crash / do other weird stuff. Use PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP instead of PTHREAD_MUTEX_INITIALIZER > The bug is that Valgrind should flag this as an error. > > J Indeed. Igmar |