List:Commits« Previous MessageNext Message »
From:Marc Alff Date:October 13 2009 3:36pm
Subject:bzr commit into mysql-trunk-perfschema branch (marc.alff:2908)
View as plain text  
#At file:///home/malff/BZR_TREE/mysql-trunk-perfschema/ based on revid:marc.alff@stripped

 2908 Marc Alff	2009-10-13
      Fixed build break after manual merge,
      restored pthread_yield().

    modified:
      include/my_pthread.h
=== modified file 'include/my_pthread.h'
--- a/include/my_pthread.h	2009-10-13 00:48:16 +0000
+++ b/include/my_pthread.h	2009-10-13 15:36:16 +0000
@@ -152,6 +152,7 @@ int pthread_join(pthread_t thread, void
 #define pthread_detach_this_thread()
 #define pthread_condattr_init(A)
 #define pthread_condattr_destroy(A)
+#define pthread_yield() SwitchToThread()
 
 #define my_pthread_getprio(thread_id) pthread_dummy(0)
 
@@ -385,6 +386,17 @@ void my_pthread_attr_getstacksize(pthrea
 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


Attachment: [text/bzr-bundle] bzr/marc.alff@sun.com-20091013153616-5kb3g9rmf56exlk9.bundle
Thread
bzr commit into mysql-trunk-perfschema branch (marc.alff:2908) Marc Alff13 Oct