mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-08 06:47:09 +02:00
72 lines
2.5 KiB
Diff
72 lines
2.5 KiB
Diff
--- ./src/VBox/Runtime/r3/posix/thread2-posix.cpp.orig
|
|
+++ ./src/VBox/Runtime/r3/posix/thread2-posix.cpp
|
|
@@ -63,7 +63,7 @@
|
|
#elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU) || defined(RT_OS_FREEBSD) || defined(RT_OS_NETBSD)
|
|
sched_yield();
|
|
#else
|
|
- if (!pthread_yield())
|
|
+ if (!sched_yield())
|
|
#endif
|
|
{
|
|
LogFlow(("RTThreadSleep: returning %Rrc (cMillies=%d)\n", VINF_SUCCESS, cMillies));
|
|
@@ -100,7 +100,7 @@
|
|
#elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU) || defined(RT_OS_FREEBSD) || defined(RT_OS_NETBSD)
|
|
sched_yield();
|
|
#else
|
|
- if (!pthread_yield())
|
|
+ if (!sched_yield())
|
|
#endif
|
|
return VINF_SUCCESS;
|
|
}
|
|
@@ -126,10 +126,8 @@
|
|
#endif
|
|
#ifdef RT_OS_DARWIN
|
|
pthread_yield_np();
|
|
-#elif defined(RT_OS_SOLARIS) || defined(RT_OS_HAIKU) || defined(RT_OS_FREEBSD) || defined(RT_OS_NETBSD)
|
|
- sched_yield();
|
|
#else
|
|
- pthread_yield();
|
|
+ sched_yield();
|
|
#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);
|