/* Locking in multithreaded situations.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005-2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
# include <pthread.h>
# include <stdlib.h>
+# ifdef __cplusplus
+extern "C" {
+# endif
+
# if PTHREAD_IN_USE_DETECTION_HARD
/* The pthread_in_use() detection needs to be done at runtime. */
while (0)
extern int glthread_once_singlethreaded (pthread_once_t *once_control);
+# ifdef __cplusplus
+}
+# endif
+
#endif
/* ========================================================================= */
# include <pth.h>
# include <stdlib.h>
+# ifdef __cplusplus
+extern "C" {
+# endif
+
# if USE_PTH_THREADS_WEAK
/* Use weak references to the GNU Pth threads library. */
extern void glthread_once_call (void *arg);
extern int glthread_once_singlethreaded (pth_once_t *once_control);
+# ifdef __cplusplus
+}
+# endif
+
#endif
/* ========================================================================= */
# include <synch.h>
# include <stdlib.h>
+# ifdef __cplusplus
+extern "C" {
+# endif
+
# if USE_SOLARIS_THREADS_WEAK
/* Use weak references to the old Solaris threads library. */
extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void));
extern int glthread_once_singlethreaded (gl_once_t *once_control);
+# ifdef __cplusplus
+}
+# endif
+
#endif
/* ========================================================================= */
# include <windows.h>
+# ifdef __cplusplus
+extern "C" {
+# endif
+
/* We can use CRITICAL_SECTION directly, rather than the Win32 Event, Mutex,
Semaphore types, because
- we need only to synchronize inside a single process (address space),
glthread_once (&NAME, INITFUNCTION)
extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void));
+# ifdef __cplusplus
+}
+# endif
+
#endif
/* ========================================================================= */