Reviewers: danno, Sven Panne,

Description:
Don't use recursive mutexes.

There's no need to actually use recursive mutexes within V8. To
aid in debugging threading issues, we use error-checking mutexes
if DEBUG is enabled.

[email protected], [email protected]

Please review this at https://codereview.chromium.org/21233002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/platform-posix.cc


Index: src/platform-posix.cc
diff --git a/src/platform-posix.cc b/src/platform-posix.cc
index 13b819bd1e79c1452979961fd082c2af73171e56..1ff29e85abf840ed178b1f67cad6811e80d6add0 100644
--- a/src/platform-posix.cc
+++ b/src/platform-posix.cc
@@ -763,7 +763,11 @@ class POSIXMutex : public Mutex {
     memset(&attr, 0, sizeof(attr));
     int result = pthread_mutexattr_init(&attr);
     ASSERT(result == 0);
-    result = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+#ifdef DEBUG
+    result = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
+#else
+    result = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
+#endif
     ASSERT(result == 0);
     result = pthread_mutex_init(&mutex_, &attr);
     ASSERT(result == 0);


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to