aboutsummaryrefslogtreecommitdiffstats
path: root/community/virtualbox-guest-additions/musl-sched_yield.patch
diff options
context:
space:
mode:
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);