summaryrefslogtreecommitdiff
path: root/pthread.h
diff options
context:
space:
mode:
authorrpj <rpj>1999-01-12 14:48:53 +0000
committerrpj <rpj>1999-01-12 14:48:53 +0000
commitbc374000d4dda28009ceb1f03a5514687be8904c (patch)
treeed0423713c55ec8c5fcd7ea801edbda62bef6ab7 /pthread.h
parent66f7d3aafbde9b4f628dcdc23c7f59b28d86760b (diff)
Wed Jan 13 09:34:52 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* build.bat: Delete old binaries before compiling/linking. Tue Jan 12 09:58:38 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * dll.c: The Microsoft compiler pragmas probably are more appropriately protected by _MSC_VER than by _WIN32. - Tor Lillqvist <tml@iki.fi>. * condvar.c (pthread_cond_timedwait): Fix function description comments. * pthread.h: Define ETIMEDOUT. This should be returned by pthread_cond_timedwait which is not implemented yet as of snapshot-1999-01-04-1305. It was implemented in the older version. The Microsoft compiler pragmas probably are more appropriately protected by _MSC_VER than by _WIN32. - Tor Lillqvist <tml@iki.fi>. * pthread.def: pthread_mutex_destroy was missing from the def file - Tor Lillqvist <tml@iki.fi>. * condvar.c (pthread_cond_broadcast): Ensure we only wait on threads if there were any waiting on the condition. I think pthread_cond_broadcast should do the WaitForSingleObject only if cv->waiters > 0? Otherwise it seems to hang, at least in the testg thread program from glib. - Tor Lillqvist <tml@iki.fi>. * semaphore.c (sem_post): Correct typo in comment. Mon Jan 11 20:33:19 1999 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * pthread.h: Re-arrange conditional compile of pthread_cleanup-* macros. * cleanup.c (_pthread_push_cleanup): Provide conditional compile of cleanup->prev.
Diffstat (limited to 'pthread.h')
-rw-r--r--pthread.h52
1 files changed, 30 insertions, 22 deletions
diff --git a/pthread.h b/pthread.h
index 702028f..455cf19 100644
--- a/pthread.h
+++ b/pthread.h
@@ -174,7 +174,7 @@
#if !defined( PTHREAD_H )
#define PTHREAD_H
-#ifdef _WIN32
+#ifdef _MSC_VER
/*
* Disable following warnings when including Windows headers
*
@@ -229,6 +229,12 @@ struct timespec {
#include <errno.h>
#ifdef _WIN32
+#ifndef ETIMEDOUT
+#define ETIMEDOUT 19981220 /* Let's hope this is unique */
+#endif
+#endif /* _WIN32 */
+
+#ifdef _MSC_VER
/*
* Re-enable all but 4127, 4514
*/
@@ -644,29 +650,11 @@ struct pthread_once_t_ {
{
void (*routine) (void *);
void *arg;
-#if !defined(__cplusplus)
+#if !defined(_WIN32) && !defined(__cplusplus)
_pthread_cleanup_t *prev;
#endif
};
-#ifndef __cplusplus
-
-/*
- * C implementation of PThreads cancel cleanup
- */
-
-#define pthread_cleanup_push( _rout, _arg ) \
- { \
- _pthread_cleanup_t _cleanup; \
- \
- _pthread_push_cleanup( &_cleanup, (_rout), (_arg) ); \
-
-#define pthread_cleanup_pop( _execute ) \
- (void) _pthread_pop_cleanup( _execute ); \
- }
-
-#else /* !__cplusplus */
-
#ifdef _WIN32
/*
* WIN32 SEH version of cancel cleanup.
@@ -694,6 +682,24 @@ struct pthread_once_t_ {
#else /* _WIN32 */
+#ifndef __cplusplus
+
+ /*
+ * C implementation of PThreads cancel cleanup
+ */
+
+#define pthread_cleanup_push( _rout, _arg ) \
+ { \
+ _pthread_cleanup_t _cleanup; \
+ \
+ _pthread_push_cleanup( &_cleanup, (_rout), (_arg) ); \
+
+#define pthread_cleanup_pop( _execute ) \
+ (void) _pthread_pop_cleanup( _execute ); \
+ }
+
+#else /* !__cplusplus */
+
/*
* C++ (ie. Cygwin32 or Mingw32) version of cancel cleanup.
*
@@ -783,13 +789,15 @@ pthread_t pthread_self (void);
int pthread_cancel (pthread_t thread);
-#ifndef __cplusplus
+#if !defined(__cplusplus) && !defined(_WIN32)
+
_pthread_cleanup_t *_pthread_pop_cleanup (int execute);
void _pthread_push_cleanup (_pthread_cleanup_t * cleanup,
void (*routine) (void *),
void *arg);
-#endif /* !__cplusplus */
+
+#endif /* !__cplusplus && ! _WIN32 */
int pthread_setcancelstate (int state,
int *oldstate);