summaryrefslogtreecommitdiff
path: root/condvar.c
diff options
context:
space:
mode:
authorrpj <rpj>2001-07-06 18:16:50 +0000
committerrpj <rpj>2001-07-06 18:16:50 +0000
commit06974b302eaf8f08382e6e786aea53f420c12222 (patch)
tree1b574a41dacc634a105a74127b2dac30a60bda13 /condvar.c
parent7a3104dc65b469cbb9c88b6a9c7b7bea4126a43e (diff)
Spinlocks and barriers fixed and working. Beta level.
* spin.c: Revamped and working; included static initialiser. * barrier.c: Likewise. * condvar.c: Macro constant change; inline auto init routine. * mutex.c: Likewise. * rwlock.c: Likewise. * private.c: Add support for spinlock initialiser. * global.c: Likewise. * implement.h: Likewise. * pthread.h (PTHREAD_SPINLOCK_INITIALIZER): Fix typo. tests/ChangeLog: * spin3.c: Changed test and fixed. * spin4.c: Fixed. * barrier3.c: Fixed. * barrier4.c: Fixed.
Diffstat (limited to 'condvar.c')
-rw-r--r--condvar.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/condvar.c b/condvar.c
index 57beefd..1f2de22 100644
--- a/condvar.c
+++ b/condvar.c
@@ -152,7 +152,7 @@
#include "pthread.h"
#include "implement.h"
-static int
+static INLINE int
ptw32_cond_check_need_init (pthread_cond_t *cond)
{
int result = 0;
@@ -187,7 +187,7 @@ ptw32_cond_check_need_init (pthread_cond_t *cond)
* re-initialise it only by calling pthread_cond_init()
* explicitly.
*/
- if (*cond == (pthread_cond_t) PTW32_OBJECT_AUTO_INIT)
+ if (*cond == PTHREAD_COND_INITIALIZER)
{
result = pthread_cond_init(cond, NULL);
}
@@ -584,7 +584,7 @@ pthread_cond_destroy (pthread_cond_t * cond)
return EINVAL;
}
- if (*cond != (pthread_cond_t) PTW32_OBJECT_AUTO_INIT)
+ if (*cond != PTHREAD_COND_INITIALIZER)
{
cv = *cond;
@@ -649,7 +649,7 @@ pthread_cond_destroy (pthread_cond_t * cond)
/*
* Check again.
*/
- if (*cond == (pthread_cond_t) PTW32_OBJECT_AUTO_INIT)
+ if (*cond == PTHREAD_COND_INITIALIZER)
{
/*
* This is all we need to do to destroy a statically
@@ -827,7 +827,7 @@ ptw32_cond_timedwait (pthread_cond_t * cond,
* again inside the guarded section of ptw32_cond_check_need_init()
* to avoid race conditions.
*/
- if (*cond == (pthread_cond_t) PTW32_OBJECT_AUTO_INIT)
+ if (*cond == PTHREAD_COND_INITIALIZER)
{
result = ptw32_cond_check_need_init(cond);
}
@@ -950,7 +950,7 @@ ptw32_cond_unblock (pthread_cond_t * cond,
* No-op if the CV is static and hasn't been initialised yet.
* Assuming that any race condition is harmless.
*/
- if (cv == (pthread_cond_t) PTW32_OBJECT_AUTO_INIT)
+ if (cv == PTHREAD_COND_INITIALIZER)
{
return 0;
}