aboutsummaryrefslogtreecommitdiffstats
path: root/community/virtualbox-guest-additions/musl-sched_yield.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-01-24 15:18:50 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2017-01-24 15:19:25 +0000
commit0e2c8ae04dd5d1ed189eca252755fc5c89ffb237 (patch)
treee0f26873fa81b477d3b8de0c91958d64cd66583a /community/virtualbox-guest-additions/musl-sched_yield.patch
parent80e1d7c6321602911689f5d998021eebfba9306e (diff)
downloadaports-0e2c8ae04dd5d1ed189eca252755fc5c89ffb237.tar.bz2
aports-0e2c8ae04dd5d1ed189eca252755fc5c89ffb237.tar.xz
community/virtualbox-guest-additions: fix build on x86
Diffstat (limited to 'community/virtualbox-guest-additions/musl-sched_yield.patch')
-rw-r--r--community/virtualbox-guest-additions/musl-sched_yield.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/community/virtualbox-guest-additions/musl-sched_yield.patch b/community/virtualbox-guest-additions/musl-sched_yield.patch
index b3012e5c1a..19680e539d 100644
--- a/community/virtualbox-guest-additions/musl-sched_yield.patch
+++ b/community/virtualbox-guest-additions/musl-sched_yield.patch
@@ -30,3 +30,42 @@
#endif
#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
u64TS = ASMReadTSC() - u64TS;
+diff --git a/src/VBox/Runtime/r3/posix/semevent-posix.cpp b/src/VBox/Runtime/r3/posix/semevent-posix.cpp
+index 80d5747..4f70841 100644
+--- a/src/VBox/Runtime/r3/posix/semevent-posix.cpp
++++ b/src/VBox/Runtime/r3/posix/semevent-posix.cpp
+@@ -44,15 +44,7 @@
+ #include <pthread.h>
+ #include <unistd.h>
+ #include <sys/time.h>
+-
+-#ifdef RT_OS_DARWIN
+-# define pthread_yield() pthread_yield_np()
+-#endif
+-
+-#if defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU) || defined(RT_OS_FREEBSD) || defined(RT_OS_NETBSD)
+-# include <sched.h>
+-# define pthread_yield() sched_yield()
+-#endif
++#include <sched.h>
+
+
+ /*********************************************************************************************************************************
+@@ -317,7 +309,7 @@ DECL_FORCE_INLINE(int) rtSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillie
+ /* for fairness, yield before going to sleep. */
+ if ( ASMAtomicIncU32(&pThis->cWaiters) > 1
+ && pThis->u32State == EVENT_STATE_SIGNALED)
+- pthread_yield();
++ sched_yield();
+
+ /* take mutex */
+ int rc = pthread_mutex_lock(&pThis->Mutex);
+@@ -405,7 +397,7 @@ DECL_FORCE_INLINE(int) rtSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillie
+
+ /* for fairness, yield before going to sleep. */
+ if (ASMAtomicIncU32(&pThis->cWaiters) > 1 && cMillies)
+- pthread_yield();
++ sched_yield();
+
+ /* take mutex */
+ int rc = pthread_mutex_lock(&pThis->Mutex);