[m-rev.] diff: boehm_gc/ Use PTHREAD_MUTEX_NORMAL in the glibc lock elision bug workaround

Paul Bone paul at bone.id.au
Thu Sep 18 16:51:13 AEST 2014


boehm_gc/ Use PTHREAD_MUTEX_NORMAL in the glibc lock elision bug workaround

Peter Wang found that PTHREAD_MUTEX_NORMAL is sufficient to disable lock
elision for a mutex and avoid comprimising performance with
PTHREAD_MUTEX_ERRORCHECK.

I'll be writing to Ivan to let him know about this change.

boehm_gc/pthread_support.c:
    As above.
---
 boehm_gc/pthread_support.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/boehm_gc/pthread_support.c b/boehm_gc/pthread_support.c
index 674ef52..b12f1cf 100644
--- a/boehm_gc/pthread_support.c
+++ b/boehm_gc/pthread_support.c
@@ -1892,7 +1892,7 @@ GC_INNER void GC_setup_mark_lock(void)
       if (0 != pthread_mutexattr_init(&mattr)) {
         ABORT("pthread_mutexattr_init failed");
       }
-      if (0 != pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_ERRORCHECK)) {
+      if (0 != pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_NORMAL)) {
         ABORT("pthread_mutexattr_settype failed");
       }
       if (0 != pthread_mutex_init(&mark_mutex, &mattr)) {
-- 
2.1.0




More information about the reviews mailing list