BIND 10 trac2236, updated. 1d4d9e796c10786417099a69e8c4e6e4c1cdfb8b [2236] Use PTHREAD_MUTEX_NORMAL fast mutexes by default

BIND 10 source code commits bind10-changes at lists.isc.org
Thu Oct 25 01:29:53 UTC 2012


The branch, trac2236 has been updated
       via  1d4d9e796c10786417099a69e8c4e6e4c1cdfb8b (commit)
      from  7c4e02c157bf7a4baaa81c448ff485e7dec31182 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1d4d9e796c10786417099a69e8c4e6e4c1cdfb8b
Author: Mukund Sivaraman <muks at isc.org>
Date:   Thu Oct 25 06:49:58 2012 +0530

    [2236] Use PTHREAD_MUTEX_NORMAL fast mutexes by default

-----------------------------------------------------------------------

Summary of changes:
 src/lib/util/threads/sync.cc |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/util/threads/sync.cc b/src/lib/util/threads/sync.cc
index cf68c5e..46a5646 100644
--- a/src/lib/util/threads/sync.cc
+++ b/src/lib/util/threads/sync.cc
@@ -77,13 +77,18 @@ Mutex::Mutex() :
     }
     Deinitializer deinitializer(attributes);
 
+    // If debug mode is enabled in compilation, use the slower
+    // error-checking mutexes that detect deadlocks. Otherwise, use fast
+    // mutexes which don't. See the pthread_mutexattr_settype() POSIX
+    // documentation which describes these type attributes.
 #ifdef ENABLE_DEBUG
-    // TODO: Distinguish if debug mode is enabled in compilation.
     result = pthread_mutexattr_settype(&attributes, PTHREAD_MUTEX_ERRORCHECK);
+#else
+    result = pthread_mutexattr_settype(&attributes, PTHREAD_MUTEX_NORMAL);
+#endif // ENABLE_DEBUG
     if (result != 0) {
         isc_throw(isc::InvalidOperation, std::strerror(result));
     }
-#endif // ENABLE_DEBUG
 
     auto_ptr<Impl> impl(new Impl);
     result = pthread_mutex_init(&impl->mutex, &attributes);



More information about the bind10-changes mailing list