Commit d573e3b3 authored by iposva@chromium.org's avatar iposva@chromium.org

Landing patch for Timur Iskhodzhanov.

Reviewed at http://codereview.chromium.org/160099

The original MacOSMutex constructor makes data race detectors a little
bit crazy. Also, the new version is simpler and easier to understand.



git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2535 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 500e10b6
......@@ -424,14 +424,10 @@ class MacOSMutex : public Mutex {
public:
MacOSMutex() {
// For some reason the compiler doesn't allow you to write
// "this->mutex_ = PTHREAD_..." directly on mac.
pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&m, &attr);
mutex_ = m;
pthread_mutex_init(&mutex_, &attr);
}
~MacOSMutex() { pthread_mutex_destroy(&mutex_); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment