summaryrefslogtreecommitdiff
path: root/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'sched.c')
-rw-r--r--sched.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/sched.c b/sched.c
index c07698b..6d53d9b 100644
--- a/sched.c
+++ b/sched.c
@@ -25,8 +25,7 @@
#define ENOSUP 0
-#include <errno.h>
-
+#include "sched.h"
#include "pthread.h"
#include "implement.h"
@@ -150,3 +149,34 @@ int sched_get_priority_min(int policy)
/* This is independent of scheduling policy in Win32. */
return THREAD_PRIORITY_LOWEST;
}
+
+int sched_yield(void)
+ /*
+ * ------------------------------------------------------
+ * DOCPUBLIC
+ * This function indicates that the calling thread is
+ * willing to give up some time slices to other threads.
+ *
+ * PARAMETERS
+ * N/A
+ *
+ *
+ * DESCRIPTION
+ * This function indicates that the calling thread is
+ * willing to give up some time slices to other threads.
+ * NOTE: Since this is part of POSIX 1003.1b
+ * (realtime extensions), it is defined as returning
+ * -1 if an error occurs and sets errno to the actual
+ * error.
+ *
+ * RESULTS
+ * 0 successfully created semaphore,
+ * ENOSYS sched_yield not supported,
+ *
+ * ------------------------------------------------------
+ */
+{
+ Sleep(0);
+
+ return 0;
+}