BIND 10 master, updated. f49a40682835963334f3d5f2014bfed6b0895400 [master] Disable MutexTest.destoryLocked on Solaris

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Oct 26 06:31:39 UTC 2012


The branch, master has been updated
       via  f49a40682835963334f3d5f2014bfed6b0895400 (commit)
      from  dc3884d6b3e3f80144d57a6edc0223d97f5a46af (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 f49a40682835963334f3d5f2014bfed6b0895400
Author: Mukund Sivaraman <muks at isc.org>
Date:   Fri Oct 26 08:44:57 2012 +0530

    [master] Disable MutexTest.destoryLocked on Solaris

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

Summary of changes:
 configure.ac                                |    4 ++++
 src/lib/util/threads/tests/lock_unittest.cc |    8 +++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 5bbba16..a9d5a81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -217,6 +217,10 @@ case "$host" in
 	CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
 	# "now" binding is necessary to prevent deadlocks in C++ static initialization code
 	LDFLAGS="$LDFLAGS -z now"
+	# Destroying locked mutexes, condition variables being waited
+	# on, etc. are undefined behavior on Solaris, so we set it as
+	# such here.
+	AC_DEFINE([HAS_UNDEFINED_PTHREAD_BEHAVIOR], [1], [Does this platform have some undefined pthreads behavior?])
 	;;
 *-apple-darwin*)
 	# Starting with OSX 10.7 (Lion) we must choose which IPv6 API to use
diff --git a/src/lib/util/threads/tests/lock_unittest.cc b/src/lib/util/threads/tests/lock_unittest.cc
index 498d01e..1abc3fa 100644
--- a/src/lib/util/threads/tests/lock_unittest.cc
+++ b/src/lib/util/threads/tests/lock_unittest.cc
@@ -12,6 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
+#include <config.h>
+
 #include <gtest/gtest.h>
 
 #include <util/threads/sync.h>
@@ -46,11 +48,11 @@ TEST(MutexTest, lockMultiple) {
 
 #endif // ENABLE_DEBUG
 
+#ifndef HAS_UNDEFINED_PTHREAD_BEHAVIOR
 // Destroying a locked mutex is a bad idea as well
-#ifdef EXPECT_DEATH
 TEST(MutexTest, destroyLocked) {
     if (!isc::util::unittests::runningOnValgrind()) {
-        EXPECT_DEATH({
+        EXPECT_DEATH_IF_SUPPORTED({
             Mutex* mutex = new Mutex;
             new Mutex::Locker(*mutex);
             delete mutex;
@@ -59,7 +61,7 @@ TEST(MutexTest, destroyLocked) {
         }, "");
     }
 }
-#endif
+#endif // !HAS_UNDEFINED_PTHREAD_BEHAVIOR
 
 // In this test, we try to check if a mutex really locks. We could try that
 // with a deadlock, but that's not practical (the test would not end).



More information about the bind10-changes mailing list