]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3710] Use undefined pthread behavior for FreeBSD.
authorMarcin Siodelski <marcin@isc.org>
Mon, 2 Mar 2015 17:43:13 +0000 (18:43 +0100)
committerMarcin Siodelski <marcin@isc.org>
Mon, 2 Mar 2015 17:43:13 +0000 (18:43 +0100)
This prevents failure of the CondVar unit tests which expect that the
pthread_cond_destroy returns error code if the other thread is blocked
on the conditional variable which is being destroyed.

configure.ac

index de5c262c95da012e1082cef24ebbc8b2661a591c..65810afe6787f8bbd83037fd6684b9b5c8acf389 100644 (file)
@@ -278,6 +278,17 @@ case "$host" in
        ENV_LIBRARY_PATH=DYLD_LIBRARY_PATH
        ;;
 *-freebsd*)
+       # On FreeBSD10.1 pthread_cond_destroy doesn't work as documented, which
+       # causes the CondVarTest.destroyWhileWait test to fail. According to the
+       # pthread_cond_destroy documentation for FreeBSD, this function should
+       # return EBUSY error when there is a thread waiting for the conditional
+       # variable, whereas this function returned success code. We treat it here
+       # as an undefined behavior. Also note that this issue was only visible
+       # when gtest 1.7 was in use, because the previous versions of gtest
+       # didn't seem to have support for the death tests on FreeBSD. As a
+       # result, the test was not executed and the error didn't occur.
+       kea_undefined_pthread_behavior=yes
+
        SET_ENV_LIBRARY_PATH=yes
        ;;
 *-netbsd*)