summaryrefslogtreecommitdiff
path: root/include/my_pthread.h
diff options
context:
space:
mode:
authorunknown <serg@janus.mylan>2007-12-13 13:28:35 +0100
committerunknown <serg@janus.mylan>2007-12-13 13:28:35 +0100
commitbcf526b72a540447940ca021750614c1fff15b79 (patch)
treeb1cfc56cae84cc629b813aecc99e36d92baf6ddf /include/my_pthread.h
parent298541f7a39f554f1393734a8986455e8c7e2384 (diff)
downloadmariadb-git-bcf526b72a540447940ca021750614c1fff15b79.tar.gz
fixes for make distclean, solaris, macosx, windows
BitKeeper/deleted/.del-plug.in: Delete: storage/myisam/plug.in configure.in: MyISAM should be the first plugin in the list for now check for thr_yield, just in case include/my_pthread.h: pthread_yield for windows, solaris, macosx storage/Makefile.am: fix for make distclean (myisam was listed twice in SUBDIRS)
Diffstat (limited to 'include/my_pthread.h')
-rw-r--r--include/my_pthread.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/my_pthread.h b/include/my_pthread.h
index ae44b6b8bfd..b61de3bf2ff 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -171,6 +171,7 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#define pthread_detach_this_thread()
#define pthread_condattr_init(A)
#define pthread_condattr_destroy(A)
+#define pthread_yield() Sleep(0) /* according to MSDN */
#define my_pthread_getprio(thread_id) pthread_dummy(0)
@@ -396,6 +397,17 @@ void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size);
int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#endif
+#if !defined(HAVE_PTHREAD_YIELD_ONE_ARG) && !defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
+/* no pthread_yield() available */
+#ifdef HAVE_SCHED_YIELD
+#define pthread_yield() sched_yield()
+#elif defined(HAVE_PTHREAD_YIELD_NP) /* can be Mac OS X */
+#define pthread_yield() pthread_yield_np()
+#elif defined(HAVE_THR_YIELD)
+#define pthread_yield() thr_yield()
+#endif
+#endif
+
/*
The defines set_timespec and set_timespec_nsec should be used
for calculating an absolute time at which