[Webkit-unassigned] [Bug 39893] Explicitly use PTHREAD_MUTEX_NORMAL to create pthread mutex

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 1 08:57:01 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=39893





--- Comment #20 from Yong Li <yong.li.webkit at gmail.com>  2010-06-01 08:56:59 PST ---
(In reply to comment #19)
> (In reply to comment #17)
> > If we don't initialize the mutex, what if the mutex just happens to be the same value as PTHREAD_MUTEXT_INITIALIZER? Although the chance if very small.
> 
> Not important to this patch any more, but that question shows a misunderstanding. There's no way you could set the mutex to a value and guarantee it's not the same as PTHREAD_MUTEX_INITIALIZER, nor would you want to. I think you're just reading too much into some documentation you read. pthread_mutex_init does not require that before you call it you set the mutex up with a bit pattern that happens to not be equal to PTHREAD_MUTEX_INITIALIZER. And if it did require that I'm not sure how you would accomplish that portably anyway. There are two ways to initialize a pthreads mutex. One is to call pthread_mutex_init and the other is to use PTHREAD_MUTEX_INITIALIZER. In our case we are using pthread_mutex_init.

yeah. probably I have thought too much

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list