projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fnmatch: don't goto over declaration
[gnulib.git]
/
lib
/
pthread.in.h
diff --git
a/lib/pthread.in.h
b/lib/pthread.in.h
index
43023c2
..
7fcfb0b
100644
(file)
--- a/
lib/pthread.in.h
+++ b/
lib/pthread.in.h
@@
-1,6
+1,6
@@
/* Implement a trivial subset of POSIX 1003.1-2008 pthread.h.
/* Implement a trivial subset of POSIX 1003.1-2008 pthread.h.
- Copyright (C) 2009-201
2
Free Software Foundation, Inc.
+ Copyright (C) 2009-201
3
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
@@
-13,8
+13,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 Paul Eggert and Glen Lenker. */
/* Written by Paul Eggert and Glen Lenker. */
@@
-33,12
+32,20
@@
#ifndef _@GUARD_PREFIX@_PTHREAD_H_
#define _@GUARD_PREFIX@_PTHREAD_H_
#ifndef _@GUARD_PREFIX@_PTHREAD_H_
#define _@GUARD_PREFIX@_PTHREAD_H_
-#
include <errno.h>
+#
define __need_system_stdlib_h
#include <stdlib.h>
#include <stdlib.h>
+#undef __need_system_stdlib_h
+
+#include <errno.h>
#include <sched.h>
#include <sys/types.h>
#include <time.h>
#include <sched.h>
#include <sys/types.h>
#include <time.h>
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_PTHREAD_INLINE
+# define _GL_PTHREAD_INLINE _GL_INLINE
+#endif
+
#if ! @HAVE_PTHREAD_T@
# if !GNULIB_defined_pthread_types
typedef int pthread_t;
#if ! @HAVE_PTHREAD_T@
# if !GNULIB_defined_pthread_types
typedef int pthread_t;
@@
-111,14
+118,14
@@
know what to do, so that they elicit a compile-time error for
now. */
know what to do, so that they elicit a compile-time error for
now. */
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_cond_destroy (pthread_cond_t *cond)
{
/* COND is never seriously used. */
return 0;
}
pthread_cond_destroy (pthread_cond_t *cond)
{
/* COND is never seriously used. */
return 0;
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_cond_init (pthread_cond_t *restrict cond,
pthread_condattr_t const *restrict attr)
{
pthread_cond_init (pthread_cond_t *restrict cond,
pthread_condattr_t const *restrict attr)
{
@@
-126,14
+133,14
@@
pthread_cond_init (pthread_cond_t *restrict cond,
return 0;
}
return 0;
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_cond_signal (pthread_cond_t *cond)
{
/* No threads can currently be blocked on COND. */
return 0;
}
pthread_cond_signal (pthread_cond_t *cond)
{
/* No threads can currently be blocked on COND. */
return 0;
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_cond_wait (pthread_cond_t *restrict cond,
pthread_mutex_t *restrict mutex)
{
pthread_cond_wait (pthread_cond_t *restrict cond,
pthread_mutex_t *restrict mutex)
{
@@
-142,7
+149,7
@@
pthread_cond_wait (pthread_cond_t *restrict cond,
return 0;
}
return 0;
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_create (pthread_t *restrict thread,
pthread_attr_t const *restrict attr,
void * (*start_routine) (void*), void *restrict arg)
pthread_create (pthread_t *restrict thread,
pthread_attr_t const *restrict attr,
void * (*start_routine) (void*), void *restrict arg)
@@
-151,14
+158,14
@@
pthread_create (pthread_t *restrict thread,
return EAGAIN;
}
return EAGAIN;
}
-
static inline
void
+
_GL_PTHREAD_INLINE
void
pthread_exit (void *value)
{
/* There is just one thread, so the process exits. */
exit (0);
}
pthread_exit (void *value)
{
/* There is just one thread, so the process exits. */
exit (0);
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_join (pthread_t thread, void **pvalue)
{
/* Properly-written applications never come here. */
pthread_join (pthread_t thread, void **pvalue)
{
/* Properly-written applications never come here. */
@@
-166,32
+173,32
@@
pthread_join (pthread_t thread, void **pvalue)
return 0;
}
return 0;
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_mutexattr_destroy (pthread_mutexattr_t *attr)
{
return 0;
}
pthread_mutexattr_destroy (pthread_mutexattr_t *attr)
{
return 0;
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_mutexattr_init (pthread_mutexattr_t *attr)
{
return 0;
}
pthread_mutexattr_init (pthread_mutexattr_t *attr)
{
return 0;
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_mutexattr_settype (pthread_mutexattr_t *attr, int attr_type)
{
return 0;
}
pthread_mutexattr_settype (pthread_mutexattr_t *attr, int attr_type)
{
return 0;
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_mutex_destroy (pthread_mutex_t *mutex)
{
/* MUTEX is never seriously used. */
return 0;
}
pthread_mutex_destroy (pthread_mutex_t *mutex)
{
/* MUTEX is never seriously used. */
return 0;
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_mutex_init (pthread_mutex_t *restrict mutex,
pthread_mutexattr_t const *restrict attr)
{
pthread_mutex_init (pthread_mutex_t *restrict mutex,
pthread_mutexattr_t const *restrict attr)
{
@@
-199,7
+206,7
@@
pthread_mutex_init (pthread_mutex_t *restrict mutex,
return 0;
}
return 0;
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_mutex_lock (pthread_mutex_t *mutex)
{
/* There is only one thread, so it always gets the lock. This
pthread_mutex_lock (pthread_mutex_t *mutex)
{
/* There is only one thread, so it always gets the lock. This
@@
-207,13
+214,13
@@
pthread_mutex_lock (pthread_mutex_t *mutex)
return 0;
}
return 0;
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_mutex_trylock (pthread_mutex_t *mutex)
{
return pthread_mutex_lock (mutex);
}
pthread_mutex_trylock (pthread_mutex_t *mutex)
{
return pthread_mutex_lock (mutex);
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_mutex_unlock (pthread_mutex_t *mutex)
{
/* There is only one thread, so it always unlocks successfully.
pthread_mutex_unlock (pthread_mutex_t *mutex)
{
/* There is only one thread, so it always unlocks successfully.
@@
-235,31
+242,31
@@
pthread_mutex_unlock (pthread_mutex_t *mutex)
typedef pthread_mutex_t pthread_spinlock_t;
typedef pthread_mutex_t pthread_spinlock_t;
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_spin_init (pthread_spinlock_t *lock, int pshared)
{
return pthread_mutex_init (lock, NULL);
}
pthread_spin_init (pthread_spinlock_t *lock, int pshared)
{
return pthread_mutex_init (lock, NULL);
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_spin_destroy (pthread_spinlock_t *lock)
{
return pthread_mutex_destroy (lock);
}
pthread_spin_destroy (pthread_spinlock_t *lock)
{
return pthread_mutex_destroy (lock);
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_spin_lock (pthread_spinlock_t *lock)
{
return pthread_mutex_lock (lock);
}
pthread_spin_lock (pthread_spinlock_t *lock)
{
return pthread_mutex_lock (lock);
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_spin_trylock (pthread_spinlock_t *lock)
{
return pthread_mutex_trylock (lock);
}
pthread_spin_trylock (pthread_spinlock_t *lock)
{
return pthread_mutex_trylock (lock);
}
-
static inline
int
+
_GL_PTHREAD_INLINE
int
pthread_spin_unlock (pthread_spinlock_t *lock)
{
return pthread_mutex_unlock (lock);
pthread_spin_unlock (pthread_spinlock_t *lock)
{
return pthread_mutex_unlock (lock);
@@
-270,5
+277,7
@@
pthread_spin_unlock (pthread_spinlock_t *lock)
#endif
#endif
+_GL_INLINE_HEADER_END
+
#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */
#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */
#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */
#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */