[Webkit-unassigned] [Bug 39893] Explicitly use PTHREAD_MUTEX_NORMAL to create pthread mutex
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon May 31 07:14:01 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=39893
--- Comment #13 from Yong Li <yong.li.webkit at gmail.com> 2010-05-31 07:14:00 PST ---
(In reply to comment #12)
> (From update of attachment 57417 [details])
> Patch looks generally good, but I have some concerns.
> > + // Make sure it's not the same value as PTHREAD_MUTEX_INITIALIZER.
> This comment makes no sense. Why is it important to make sure that something is not the same value as PTHREAD_MUTEX_INITIALIZER? How is that relevant at all?
pthread_mutex_init and pthread_mutex_destroy are not supposed to be called on PTHREAD_MUTEX_INITIALIZER. I cannot find any scription that defines the behavior. So I assume the behavior is undefined, and up to implementation.
> > + // Static variables are always zeroed.
> > + static pthread_mutex_t s_zeroedMutex;
> > + m_mutex = s_zeroedMutex;
> It seems really strange to do it that way. If you just want to zero something out, the best way I can think of is:
> memset(&m_mutex, 0, sizeof(m_mutex));
> No need for a global variable.
I can change it to memset
--
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