25 lines
897 B
Plaintext
25 lines
897 B
Plaintext
--- cl-original/kernel/thread.h 2021-06-24 14:55:26.169597780 +0200
|
|
+++ cl-patched/kernel/thread.h 2021-06-24 14:58:02.485568178 +0200
|
|
@@ -2979,6 +2979,8 @@
|
|
"Posix is portable in the sense that you can use a forklift to move the
|
|
printed volumes around" */
|
|
|
|
+#include <sched.h>
|
|
+
|
|
#define THREADFUNC_DEFINE( name, arg ) void *name( void *arg )
|
|
#define THREAD_CREATE( function, arg, threadHandle, syncHandle, status ) \
|
|
{ \
|
|
@@ -3016,7 +3018,11 @@
|
|
#if defined( __linux__ ) && !defined( __USE_GNU )
|
|
void pthread_yield( void );
|
|
#endif /* Present but not prototyped unless GNU extensions are enabled */
|
|
- #define THREAD_YIELD() pthread_yield()
|
|
+
|
|
+ #if defined( __linux__ ) && ( OSVERSION > 3 )
|
|
+ #define THREAD_YIELD() sched_yield()
|
|
+ #endif
|
|
+
|
|
#endif /* Not-very-portable Posix portability */
|
|
#define THREAD_SLEEP( ms ) { \
|
|
struct timeval tv = { 0 }; \
|