summaryrefslogtreecommitdiff
path: root/include/my_no_pthread.h
diff options
context:
space:
mode:
authorunknown <joerg@mysql.com>2006-03-10 17:13:54 +0100
committerunknown <joerg@mysql.com>2006-03-10 17:13:54 +0100
commit7738937691df245791e87e942d65139d2e6ceb54 (patch)
treed341f9536ebcfc64678052a6d210a339bd54017b /include/my_no_pthread.h
parenta7717c72ebdc86f24a5b304a3887d6dd267ff89c (diff)
downloadmariadb-git-7738937691df245791e87e942d65139d2e6ceb54.tar.gz
Include the system header file "pthread.h" even in a non-threaded build.
Fixes bug#15861 include/my_no_pthread.h: Even in a non-threaded build, some modules (at least "mysys/mf_keycache.c") need some type definitions provided by the system header file "pthread.h". Rather than add complexity to the code, include the header. Fixes bug#15861
Diffstat (limited to 'include/my_no_pthread.h')
-rw-r--r--include/my_no_pthread.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/include/my_no_pthread.h b/include/my_no_pthread.h
index 2c9cde65e78..5691de08783 100644
--- a/include/my_no_pthread.h
+++ b/include/my_no_pthread.h
@@ -14,15 +14,34 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#if !defined(_my_no_pthread_h) && !defined(THREAD)
+#define _my_no_pthread_h
+
+
+/*
+ This block is to access some thread-related type definitions
+ even in builds which do not need thread functions,
+ as some variables (based on these types) are declared
+ even in non-threaded builds.
+ Case in point: 'mf_keycache.c'
+*/
+#if defined(__WIN__) || defined(OS2)
+
+#elif defined(HAVE_UNIXWARE7_THREADS)
+/* #include <thread.h> Currently, not relevant. Enable if needed. */
+
+#else /* Normal threads */
+#include <pthread.h>
+
+#endif /* defined(__WIN__) */
+
+
/*
This undefs some pthread mutex locks when one isn't using threads
to make thread safe code, that should also work in single thread
environment, easier to use.
*/
-
-#if !defined(_my_no_pthread_h) && !defined(THREAD)
-#define _my_no_pthread_h
-
#define pthread_mutex_init(A,B)
#define pthread_mutex_lock(A)
#define pthread_mutex_unlock(A)
@@ -32,4 +51,5 @@
#define rw_wrlock(A)
#define rw_unlock(A)
#define rwlock_destroy(A)
+
#endif