projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
maint: update copyright
[gnulib.git]
/
lib
/
glthread
/
thread.h
diff --git
a/lib/glthread/thread.h
b/lib/glthread/thread.h
index
3d7f760
..
6437071
100644
(file)
--- a/
lib/glthread/thread.h
+++ b/
lib/glthread/thread.h
@@
-1,5
+1,5
@@
/* Creating and controlling threads.
/* Creating and controlling threads.
- Copyright (C) 2005-201
1
Free Software Foundation, Inc.
+ Copyright (C) 2005-201
4
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
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
@@
-12,8
+12,7
@@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2005.
Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
/* Written by Bruno Haible <bruno@clisp.org>, 2005.
Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
@@
-75,6
+74,14
@@
#include <errno.h>
#include <stdlib.h>
#include <errno.h>
#include <stdlib.h>
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GLTHREAD_THREAD_INLINE
+# define _GLTHREAD_THREAD_INLINE _GL_INLINE
+#endif
+
/* ========================================================================= */
#if USE_POSIX_THREADS
/* ========================================================================= */
#if USE_POSIX_THREADS
@@
-116,7
+123,13
@@
extern int glthread_in_use (void);
address of a function in libpthread that we don't use. */
# pragma weak pthread_create
address of a function in libpthread that we don't use. */
# pragma weak pthread_create
+
+# ifdef __clang__
+ /* Without this, clang complains that pthread_sigmask is never declared. */
+# include <signal.h>
+# endif
# pragma weak pthread_sigmask
# pragma weak pthread_sigmask
+
# pragma weak pthread_join
# ifndef pthread_self
# pragma weak pthread_self
# pragma weak pthread_join
# ifndef pthread_self
# pragma weak pthread_self
@@
-290,8
+303,9
@@
typedef thread_t gl_thread_t;
/* ========================================================================= */
/* ========================================================================= */
-#if USE_WIN
32
_THREADS
+#if USE_WIN
DOWS
_THREADS
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
# include <windows.h>
# ifdef __cplusplus
# include <windows.h>
# ifdef __cplusplus
@@
-336,7
+350,7
@@
extern int gl_thread_exit_func (void *retval);
/* ========================================================================= */
/* ========================================================================= */
-#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN
32
_THREADS)
+#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN
DOWS
_THREADS)
/* Provide dummy implementation if threads are not supported. */
/* Provide dummy implementation if threads are not supported. */
@@
-360,7
+374,7
@@
typedef int gl_thread_t;
extern "C" {
#endif
extern "C" {
#endif
-
static inline
gl_thread_t
+
_GLTHREAD_THREAD_INLINE
gl_thread_t
gl_thread_create (void *(*func) (void *arg), void *arg)
{
gl_thread_t thread;
gl_thread_create (void *(*func) (void *arg), void *arg)
{
gl_thread_t thread;
@@
-397,4
+411,6
@@
gl_thread_create (void *(*func) (void *arg), void *arg)
}
#endif
}
#endif
+_GL_INLINE_HEADER_END
+
#endif /* _GLTHREAD_THREAD_H */
#endif /* _GLTHREAD_THREAD_H */