summaryrefslogtreecommitdiff
path: root/src/VBox/Runtime/r3/linux/semevent-linux.cpp
diff options
context:
space:
mode:
authorvboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2008-11-20 17:23:43 +0000
committervboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2008-11-20 17:23:43 +0000
commit0e184e432fbfd51367ccc83451bdf3f786fd8edc (patch)
treef819348046ad2c16cb388f6c8e70f99563e699d8 /src/VBox/Runtime/r3/linux/semevent-linux.cpp
parentae72571a6409489c22da944a10f30649541cc5be (diff)
downloadVirtualBox-svn-0e184e432fbfd51367ccc83451bdf3f786fd8edc.tar.gz
when building against glibc 2.6, use the Posix implementation of the event mutexes as the glibc futex bug is fixed there
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@14429 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src/VBox/Runtime/r3/linux/semevent-linux.cpp')
-rw-r--r--src/VBox/Runtime/r3/linux/semevent-linux.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/VBox/Runtime/r3/linux/semevent-linux.cpp b/src/VBox/Runtime/r3/linux/semevent-linux.cpp
index 3cade821d98..812d5bcd362 100644
--- a/src/VBox/Runtime/r3/linux/semevent-linux.cpp
+++ b/src/VBox/Runtime/r3/linux/semevent-linux.cpp
@@ -28,6 +28,19 @@
* additional information or have any questions.
*/
+#include <features.h>
+#if __GLIBC_PREREQ(2,6)
+
+/* glibc 2.6 fixed a serious bug in the mutex implementation
+ * The external refernce to epoll_pwait is a hack which prevents
+ * that we link against glibc < 2.6 */
+
+asm volatile (".global epoll_pwait");
+
+#include "r3/posix/semevent-posix.cpp"
+
+#else /* glibc < 2.6 */
+
/*******************************************************************************
* Header Files *
*******************************************************************************/
@@ -296,3 +309,4 @@ RTDECL(int) RTSemEventWaitNoResume(RTSEMEVENT EventSem, unsigned cMillies)
return rtSemEventWait(EventSem, cMillies, false);
}
+#endif /* glibc < 2.6 */