summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Bmakefile2
-rw-r--r--CONTRIBUTORS4
-rw-r--r--GNUmakefile2
-rw-r--r--Makefile2
-rw-r--r--Nmakefile2
-rwxr-xr-xautostatic.c4
-rw-r--r--builddmc.bat4
-rw-r--r--need_errno.h4
-rw-r--r--pthread.h6
-rw-r--r--pthread_cancel.c2
-rw-r--r--ptw32_MCS_lock.c20
-rw-r--r--ptw32_relmillisecs.c5
-rwxr-xr-xtests/SIZES.GCE28
-rw-r--r--tests/barrier3.c2
-rw-r--r--tests/barrier5.c2
-rw-r--r--tests/cancel2.c2
-rw-r--r--tests/cleanup0.c2
-rw-r--r--tests/cleanup1.c2
-rw-r--r--tests/cleanup2.c2
-rw-r--r--tests/cleanup3.c2
-rw-r--r--tests/condvar1_2.c2
-rw-r--r--tests/condvar2_1.c2
-rw-r--r--tests/condvar3_1.c2
-rw-r--r--tests/condvar3_2.c2
-rw-r--r--tests/delay2.c2
-rw-r--r--tests/exception1.c2
-rw-r--r--tests/exception2.c2
-rw-r--r--tests/join0.c2
-rw-r--r--tests/join1.c2
-rw-r--r--tests/join2.c2
-rw-r--r--tests/join3.c2
-rw-r--r--tests/mutex6e.c2
-rw-r--r--tests/mutex6es.c2
-rw-r--r--tests/mutex6r.c2
-rw-r--r--tests/mutex6rs.c2
-rw-r--r--tests/mutex7e.c2
-rw-r--r--tests/mutex7r.c2
-rw-r--r--tests/rwlock6.c6
-rw-r--r--tests/rwlock6_t.c8
-rw-r--r--tests/semaphore1.c4
-rw-r--r--tests/semaphore4.c2
41 files changed, 84 insertions, 69 deletions
diff --git a/Bmakefile b/Bmakefile
index 66707bf..300cefd 100644
--- a/Bmakefile
+++ b/Bmakefile
@@ -21,7 +21,7 @@ OPTIM = /O2
RC = brcc32
RCFLAGS = -i.
-CFLAGS = /q /I. /D_WIN32_WINNT=0x400 /DHAVE_CONFIG_H=1 /4 /tWD /tWM \
+CFLAGS = /q /I. /D_WIN32_WINNT=0x400 /DHAVE_PTW32_CONFIG_H=1 /4 /tWD /tWM \
/w-aus /w-asc /w-par
#C cleanup code
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 334b945..836e105 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -7,7 +7,7 @@ Ben Elliston bje at cygnus dot com
Initiated the project;
setup the project infrastructure (CVS, web page, etc.);
early prototype routines.
-Ross Johnson rpj at callisto dot canberra dot edu dot au
+Ross Johnson Ross dot Johnson at dot homemail dot com dot au
early prototype routines;
ongoing project coordination/maintenance;
implementation of spin locks and barriers;
@@ -131,4 +131,4 @@ Vladimir Kliatchko vladimir at kliatchko dot com
Ramiro Polla ramiro.polla at gmail.com
static library auto init/cleanup on application
start/exit via RT hooks (MSC and GCC compilers only).
- \ No newline at end of file
+
diff --git a/GNUmakefile b/GNUmakefile
index ceffd9f..b357c39 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -99,7 +99,7 @@ GCE_CFLAGS = $(PTW32_FLAGS) -mthreads
## Mingw32
MAKE ?= make
-CFLAGS = $(OPT) $(XOPT) -I. -DHAVE_CONFIG_H -Wall
+CFLAGS = $(OPT) $(XOPT) -I. -DHAVE_PTW32_CONFIG_H -Wall
DLL_INLINED_OBJS = \
pthread.o \
diff --git a/Makefile b/Makefile
index 6919117..4b790c0 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@ STATIC_STAMPS = pthreadVCE$(DLL_VER).static pthreadVSE$(DLL_VER).static pthreadV
OPTIM = /O2 /Ob2
OPTIMD =
-CFLAGS = /W3 /MD /nologo /I. /D_WIN32_WINNT=0x400 /DHAVE_CONFIG_H
+CFLAGS = /W3 /MD /nologo /I. /D_WIN32_WINNT=0x400 /DHAVE_PTW32_CONFIG_H
CFLAGSD = /Z7 $(CFLAGS)
# Uncomment this if config.h defines RETAIN_WSALASTERROR
diff --git a/Nmakefile b/Nmakefile
index e6c74dd..d9e5bf1 100644
--- a/Nmakefile
+++ b/Nmakefile
@@ -4,7 +4,7 @@
VERSION = -
CCFLAGS = -V -g $(CC.DLL)
-HAVE_CONFIG_H == 1
+HAVE_PTW32_CONFIG_H == 1
_MT == 1
_timeb == timeb
_ftime == ftime
diff --git a/autostatic.c b/autostatic.c
index ab9326a..e60bd12 100755
--- a/autostatic.c
+++ b/autostatic.c
@@ -1,8 +1,8 @@
/*
- * pthread_barrier_wait.c
+ * autostatic.c
*
* Description:
- * This translation unit implements barrier primitives.
+ * This translation unit implements static auto-init and auto-exit logic.
*
* --------------------------------------------------------------------------
*
diff --git a/builddmc.bat b/builddmc.bat
index 3edbaeb..bf813d8 100644
--- a/builddmc.bat
+++ b/builddmc.bat
@@ -3,7 +3,7 @@
set DMCDIR=c:\dm
; RELEASE
-%DMCDIR%\bin\dmc -D_WIN32_WINNT -D_MT -DHAVE_CONFIG_H -I.;c:\dm\include -o+all -WD pthread.c user32.lib+kernel32.lib+wsock32.lib -L/impl -L/NODEBUG -L/SU:WINDOWS
+%DMCDIR%\bin\dmc -D_WIN32_WINNT -D_MT -DHAVE_PTW32_CONFIG_H -I.;c:\dm\include -o+all -WD pthread.c user32.lib+kernel32.lib+wsock32.lib -L/impl -L/NODEBUG -L/SU:WINDOWS
; DEBUG
-%DMCDIR%\bin\dmc -g -D_WIN32_WINNT -D_MT -DHAVE_CONFIG_H -I.;c:\dm\include -o+all -WD pthread.c user32.lib+kernel32.lib+wsock32.lib -L/impl -L/SU:WINDOWS
+%DMCDIR%\bin\dmc -g -D_WIN32_WINNT -D_MT -DHAVE_PTW32_CONFIG_H -I.;c:\dm\include -o+all -WD pthread.c user32.lib+kernel32.lib+wsock32.lib -L/impl -L/SU:WINDOWS
diff --git a/need_errno.h b/need_errno.h
index 6099479..314e518 100644
--- a/need_errno.h
+++ b/need_errno.h
@@ -20,8 +20,8 @@
#ifndef _INC_ERRNO
#define _INC_ERRNO
-#if !defined(_WIN32) && !defined(_MAC)
-#error ERROR: Only Mac or Win32 targets supported!
+#if !defined(_WIN32)
+#error ERROR: Only Win32 targets supported!
#endif
#include <winsock.h>
diff --git a/pthread.h b/pthread.h
index 1002af3..294fe4c 100644
--- a/pthread.h
+++ b/pthread.h
@@ -112,7 +112,7 @@
#ifdef _UWIN
# define HAVE_STRUCT_TIMESPEC 1
# define HAVE_SIGNAL_H 1
-# undef HAVE_CONFIG_H
+# undef HAVE_PTW32_CONFIG_H
# pragma comment(lib, "pthread")
#endif
@@ -210,9 +210,9 @@ typedef unsigned long DWORD_PTR;
* -----------------
*/
-#if HAVE_CONFIG_H
+#if HAVE_PTW32_CONFIG_H
#include "config.h"
-#endif /* HAVE_CONFIG_H */
+#endif /* HAVE_PTW32_CONFIG_H */
#ifndef NEED_FTIME
#include <time.h>
diff --git a/pthread_cancel.c b/pthread_cancel.c
index 8ef2a11..1d2ea67 100644
--- a/pthread_cancel.c
+++ b/pthread_cancel.c
@@ -47,7 +47,7 @@ ptw32_cancel_self (void)
}
static void CALLBACK
-ptw32_cancel_callback (DWORD unused)
+ptw32_cancel_callback (ULONG_PTR unused)
{
ptw32_throw (PTW32_EPS_CANCEL);
diff --git a/ptw32_MCS_lock.c b/ptw32_MCS_lock.c
index bb942ba..ff74efa 100644
--- a/ptw32_MCS_lock.c
+++ b/ptw32_MCS_lock.c
@@ -148,7 +148,10 @@ ptw32_mcs_flag_wait (LONG * flag)
* Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors.
* ACM Transactions on Computer Systems, 9(1):21-65, Feb. 1991.
*/
-INLINE void
+#ifdef PTW32_BUILD_INLINED
+INLINE
+#endif /* PTW32_BUILD_INLINED */
+void
ptw32_mcs_lock_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * node)
{
ptw32_mcs_local_node_t *pred;
@@ -179,7 +182,10 @@ ptw32_mcs_lock_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * node)
* Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors.
* ACM Transactions on Computer Systems, 9(1):21-65, Feb. 1991.
*/
-INLINE void
+#ifdef PTW32_BUILD_INLINED
+INLINE
+#endif /* PTW32_BUILD_INLINED */
+void
ptw32_mcs_lock_release (ptw32_mcs_local_node_t * node)
{
ptw32_mcs_lock_t *lock = node->lock;
@@ -212,7 +218,10 @@ ptw32_mcs_lock_release (ptw32_mcs_local_node_t * node)
/*
* ptw32_mcs_lock_try_acquire
*/
-INLINE int
+#ifdef PTW32_BUILD_INLINED
+INLINE
+#endif /* PTW32_BUILD_INLINED */
+int
ptw32_mcs_lock_try_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * node)
{
node->lock = lock;
@@ -238,7 +247,10 @@ ptw32_mcs_lock_try_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * no
*
* Should only be called by the thread that has the lock.
*/
-INLINE void
+#ifdef PTW32_BUILD_INLINED
+INLINE
+#endif /* PTW32_BUILD_INLINED */
+void
ptw32_mcs_node_transfer (ptw32_mcs_local_node_t * new_node, ptw32_mcs_local_node_t * old_node)
{
new_node->lock = old_node->lock;
diff --git a/ptw32_relmillisecs.c b/ptw32_relmillisecs.c
index c9d39f3..a82bfb7 100644
--- a/ptw32_relmillisecs.c
+++ b/ptw32_relmillisecs.c
@@ -41,7 +41,10 @@
#endif
-INLINE DWORD
+#ifdef PTW32_BUILD_INLINED
+INLINE
+#endif /* PTW32_BUILD_INLINED */
+DWORD
ptw32_relmillisecs (const struct timespec * abstime)
{
const int64_t NANOSEC_PER_MILLISEC = 1000000;
diff --git a/tests/SIZES.GCE b/tests/SIZES.GCE
index a9ea64d..7048d3a 100755
--- a/tests/SIZES.GCE
+++ b/tests/SIZES.GCE
@@ -1,21 +1,21 @@
-Sizes of pthreads-win32 structs
--------------------------------
+Sizes of pthreads-win32 structs
+-------------------------------
pthread_t 8
ptw32_thread_t 76
- pthread_attr_t_ 28
+ pthread_attr_t_ 28
sem_t_ 12
pthread_mutex_t_ 24
- pthread_mutexattr_t_ 8
- pthread_spinlock_t_ 8
+ pthread_mutexattr_t_ 8
+ pthread_spinlock_t_ 8
pthread_barrier_t_ 36
- pthread_barrierattr_t_ 4
- pthread_key_t_ 16
- pthread_cond_t_ 32
- pthread_condattr_t_ 4
- pthread_rwlock_t_ 28
- pthread_rwlockattr_t_ 4
+ pthread_barrierattr_t_ 4
+ pthread_key_t_ 16
+ pthread_cond_t_ 32
+ pthread_condattr_t_ 4
+ pthread_rwlock_t_ 28
+ pthread_rwlockattr_t_ 4
pthread_once_t_ 16
- ptw32_cleanup_t 12
+ ptw32_cleanup_t 12
ptw32_mcs_node_t_ 16
- sched_param 4
--------------------------------
+ sched_param 4
+-------------------------------
diff --git a/tests/barrier3.c b/tests/barrier3.c
index f65b60c..dece770 100644
--- a/tests/barrier3.c
+++ b/tests/barrier3.c
@@ -60,7 +60,7 @@ main()
assert(pthread_create(&t, NULL, func, NULL) == 0);
- assert(pthread_join(t, (void *) &result) == 0);
+ assert(pthread_join(t, &result) == 0);
assert((int)(size_t)result == PTHREAD_BARRIER_SERIAL_THREAD);
diff --git a/tests/barrier5.c b/tests/barrier5.c
index 7810638..3533840 100644
--- a/tests/barrier5.c
+++ b/tests/barrier5.c
@@ -103,7 +103,7 @@ main()
serialThreadsTotal = 0;
for (i = 1; i <= j; i++)
{
- assert(pthread_join(t[i], (void *) &result) == 0);
+ assert(pthread_join(t[i], &result) == 0);
serialThreadsTotal += (int)(size_t)result;
}
diff --git a/tests/cancel2.c b/tests/cancel2.c
index 4669a28..d7c7f86 100644
--- a/tests/cancel2.c
+++ b/tests/cancel2.c
@@ -219,7 +219,7 @@ main()
int fail = 0;
void* result = (void*)0;
- assert(pthread_join(t[i], (void *) &result) == 0);
+ assert(pthread_join(t[i], &result) == 0);
fail = ((int)(size_t)result != (int) PTHREAD_CANCELED);
if (fail)
{
diff --git a/tests/cleanup0.c b/tests/cleanup0.c
index c840afe..d9fbedc 100644
--- a/tests/cleanup0.c
+++ b/tests/cleanup0.c
@@ -191,7 +191,7 @@ main()
int fail = 0;
void* result = (void*)0;
- assert(pthread_join(t[i], (void *) &result) == 0);
+ assert(pthread_join(t[i], &result) == 0);
fail = ((int)(size_t)result == (int) PTHREAD_CANCELED);
diff --git a/tests/cleanup1.c b/tests/cleanup1.c
index b326549..30d4940 100644
--- a/tests/cleanup1.c
+++ b/tests/cleanup1.c
@@ -205,7 +205,7 @@ main()
int fail = 0;
void* result = (void*)0;
- assert(pthread_join(t[i], (void *) &result) == 0);
+ assert(pthread_join(t[i], &result) == 0);
fail = ((int)(size_t)result != (int) PTHREAD_CANCELED);
diff --git a/tests/cleanup2.c b/tests/cleanup2.c
index fa32b69..67037c2 100644
--- a/tests/cleanup2.c
+++ b/tests/cleanup2.c
@@ -180,7 +180,7 @@ main()
int fail = 0;
void* result = (void*)0;
- assert(pthread_join(t[i], (void *) &result) == 0);
+ assert(pthread_join(t[i], &result) == 0);
fail = ((int)(size_t)result != 0);
diff --git a/tests/cleanup3.c b/tests/cleanup3.c
index 575ffbd..62317b3 100644
--- a/tests/cleanup3.c
+++ b/tests/cleanup3.c
@@ -185,7 +185,7 @@ main()
int fail = 0;
void* result = (void*)0;
- assert(pthread_join(t[i], (void *) &result) == 0);
+ assert(pthread_join(t[i], &result) == 0);
fail = ((int)(size_t)result != 0);
diff --git a/tests/condvar1_2.c b/tests/condvar1_2.c
index b985c5d..3d961f0 100644
--- a/tests/condvar1_2.c
+++ b/tests/condvar1_2.c
@@ -116,7 +116,7 @@ main()
}
while (j > 0);
- assert(pthread_join(t, (void *) &result) == 0);
+ assert(pthread_join(t, &result) == 0);
assert ((int)(size_t)result == 0);
}
diff --git a/tests/condvar2_1.c b/tests/condvar2_1.c
index 7d938f8..7607abd 100644
--- a/tests/condvar2_1.c
+++ b/tests/condvar2_1.c
@@ -136,7 +136,7 @@ main()
for (i = 1; i <= NUMTHREADS; i++)
{
- assert(pthread_join(t[i], (void *) &result) == 0);
+ assert(pthread_join(t[i], &result) == 0);
assert((int)(size_t)result == i);
}
diff --git a/tests/condvar3_1.c b/tests/condvar3_1.c
index e747a01..bc539d5 100644
--- a/tests/condvar3_1.c
+++ b/tests/condvar3_1.c
@@ -172,7 +172,7 @@ main()
for (i = 1; i <= NUMTHREADS; i++)
{
- assert(pthread_join(t[i], (void *) &result) == 0);
+ assert(pthread_join(t[i], &result) == 0);
assert((int)(size_t)result == i);
}
diff --git a/tests/condvar3_2.c b/tests/condvar3_2.c
index 399faec..192b842 100644
--- a/tests/condvar3_2.c
+++ b/tests/condvar3_2.c
@@ -156,7 +156,7 @@ main()
for (i = 1; i <= NUMTHREADS; i++)
{
- assert(pthread_join(t[i], (void *) &result) == 0);
+ assert(pthread_join(t[i], &result) == 0);
assert((int)(size_t)result == i);
/*
* Approximately 2/3rds of the threads are expected to time out.
diff --git a/tests/delay2.c b/tests/delay2.c
index 2551336..071b837 100644
--- a/tests/delay2.c
+++ b/tests/delay2.c
@@ -74,7 +74,7 @@ main(int argc, char * argv[])
assert(pthread_mutex_unlock(&mx) == 0);
- assert(pthread_join(t, (void *) &result) == 0);
+ assert(pthread_join(t, &result) == 0);
assert(result == (void*)PTHREAD_CANCELED);
return 0;
diff --git a/tests/exception1.c b/tests/exception1.c
index a18e078..62a5a63 100644
--- a/tests/exception1.c
+++ b/tests/exception1.c
@@ -235,7 +235,7 @@ main()
failed = (failed || fail);
/* Exceptioned thread */
- assert(pthread_join(et[i], (void *) &result) == 0);
+ assert(pthread_join(et[i], &result) == 0);
assert(!(fail = (result != (void*)((int)(size_t)PTHREAD_CANCELED + 2))));
failed = (failed || fail);
diff --git a/tests/exception2.c b/tests/exception2.c
index 222d305..faf677d 100644
--- a/tests/exception2.c
+++ b/tests/exception2.c
@@ -113,7 +113,7 @@ exceptionedThread(void * arg)
}
int
-main(int argc, char argv[])
+main(int argc, char* argv[])
{
int i;
pthread_t mt;
diff --git a/tests/join0.c b/tests/join0.c
index 3519f53..d888e9d 100644
--- a/tests/join0.c
+++ b/tests/join0.c
@@ -58,7 +58,7 @@ main(int argc, char * argv[])
/* Create a single thread and wait for it to exit. */
assert(pthread_create(&id, NULL, func, (void *) 123) == 0);
- assert(pthread_join(id, (void *) &result) == 0);
+ assert(pthread_join(id, &result) == 0);
assert((int)(size_t)result == 123);
diff --git a/tests/join1.c b/tests/join1.c
index 631b604..337af83 100644
--- a/tests/join1.c
+++ b/tests/join1.c
@@ -69,7 +69,7 @@ main(int argc, char * argv[])
for (i = 0; i < 4; i++)
{
- assert(pthread_join(id[i], (void *) &result) == 0);
+ assert(pthread_join(id[i], &result) == 0);
assert((int)(size_t)result == i);
}
diff --git a/tests/join2.c b/tests/join2.c
index 82682a8..b3b85ee 100644
--- a/tests/join2.c
+++ b/tests/join2.c
@@ -60,7 +60,7 @@ main(int argc, char * argv[])
for (i = 0; i < 4; i++)
{
- assert(pthread_join(id[i], (void *) &result) == 0);
+ assert(pthread_join(id[i], &result) == 0);
assert((int)(size_t)result == i);
}
diff --git a/tests/join3.c b/tests/join3.c
index acdc5fe..44380ac 100644
--- a/tests/join3.c
+++ b/tests/join3.c
@@ -66,7 +66,7 @@ main(int argc, char * argv[])
for (i = 0; i < 4; i++)
{
- assert(pthread_join(id[i], (void *) &result) == 0);
+ assert(pthread_join(id[i], &result) == 0);
assert((int)(size_t)result == i);
}
diff --git a/tests/mutex6e.c b/tests/mutex6e.c
index dc6e853..3f28ee7 100644
--- a/tests/mutex6e.c
+++ b/tests/mutex6e.c
@@ -86,7 +86,7 @@ main()
assert(pthread_create(&t, NULL, locker, NULL) == 0);
- assert(pthread_join(t, (void *) &result) == 0);
+ assert(pthread_join(t, &result) == 0);
assert((int)(size_t)result == 555);
assert(lockCount == 2);
diff --git a/tests/mutex6es.c b/tests/mutex6es.c
index f34b691..d4b6249 100644
--- a/tests/mutex6es.c
+++ b/tests/mutex6es.c
@@ -79,7 +79,7 @@ main()
assert(pthread_create(&t, NULL, locker, NULL) == 0);
- assert(pthread_join(t, (void *) &result) == 0);
+ assert(pthread_join(t, &result) == 0);
assert((int)(size_t)result == 555);
assert(lockCount == 2);
diff --git a/tests/mutex6r.c b/tests/mutex6r.c
index 85bb6bd..552f394 100644
--- a/tests/mutex6r.c
+++ b/tests/mutex6r.c
@@ -85,7 +85,7 @@ main()
assert(pthread_create(&t, NULL, locker, NULL) == 0);
- assert(pthread_join(t, (void *) &result) == 0);
+ assert(pthread_join(t, &result) == 0);
assert((int)(size_t)result == 555);
assert(lockCount == 2);
diff --git a/tests/mutex6rs.c b/tests/mutex6rs.c
index 6c8c1f5..4242fd6 100644
--- a/tests/mutex6rs.c
+++ b/tests/mutex6rs.c
@@ -78,7 +78,7 @@ main()
assert(pthread_create(&t, NULL, locker, NULL) == 0);
- assert(pthread_join(t, (void *) &result) == 0);
+ assert(pthread_join(t, &result) == 0);
assert((int)(size_t)result == 555);
assert(lockCount == 2);
diff --git a/tests/mutex7e.c b/tests/mutex7e.c
index 52424be..82d941f 100644
--- a/tests/mutex7e.c
+++ b/tests/mutex7e.c
@@ -86,7 +86,7 @@ main()
assert(pthread_create(&t, NULL, locker, NULL) == 0);
- assert(pthread_join(t, (void *) &result) == 0);
+ assert(pthread_join(t, &result) == 0);
assert((int)(size_t)result == 555);
assert(lockCount == 2);
diff --git a/tests/mutex7r.c b/tests/mutex7r.c
index 1ce1aa6..2c1699b 100644
--- a/tests/mutex7r.c
+++ b/tests/mutex7r.c
@@ -85,7 +85,7 @@ main()
assert(pthread_create(&t, NULL, locker, NULL) == 0);
- assert(pthread_join(t, (void *) &result) == 0);
+ assert(pthread_join(t, &result) == 0);
assert((int)(size_t)result == 555);
assert(lockCount == 2);
diff --git a/tests/rwlock6.c b/tests/rwlock6.c
index 8861823..0ac6b27 100644
--- a/tests/rwlock6.c
+++ b/tests/rwlock6.c
@@ -89,9 +89,9 @@ main()
Sleep(500);
assert(pthread_create(&wrt2, NULL, wrfunc, NULL) == 0);
- assert(pthread_join(wrt1, (void *) &wr1Result) == 0);
- assert(pthread_join(rdt, (void *) &rdResult) == 0);
- assert(pthread_join(wrt2, (void *) &wr2Result) == 0);
+ assert(pthread_join(wrt1, &wr1Result) == 0);
+ assert(pthread_join(rdt, &rdResult) == 0);
+ assert(pthread_join(wrt2, &wr2Result) == 0);
assert((int)(size_t)wr1Result == 10);
assert((int)(size_t)rdResult == 10);
diff --git a/tests/rwlock6_t.c b/tests/rwlock6_t.c
index 4af85d9..6c45b0a 100644
--- a/tests/rwlock6_t.c
+++ b/tests/rwlock6_t.c
@@ -114,10 +114,10 @@ main()
Sleep(500);
assert(pthread_create(&rdt2, NULL, rdfunc, (void *)(size_t)2) == 0);
- assert(pthread_join(wrt1, (void *) &wr1Result) == 0);
- assert(pthread_join(rdt1, (void *) &rd1Result) == 0);
- assert(pthread_join(wrt2, (void *) &wr2Result) == 0);
- assert(pthread_join(rdt2, (void *) &rd2Result) == 0);
+ assert(pthread_join(wrt1, &wr1Result) == 0);
+ assert(pthread_join(rdt1, &rd1Result) == 0);
+ assert(pthread_join(wrt2, &wr2Result) == 0);
+ assert(pthread_join(rdt2, &rd2Result) == 0);
assert((int)(size_t)wr1Result == 10);
assert((int)(size_t)rd1Result == 0);
diff --git a/tests/semaphore1.c b/tests/semaphore1.c
index de349c7..0f2eb77 100644
--- a/tests/semaphore1.c
+++ b/tests/semaphore1.c
@@ -110,7 +110,7 @@ thr(void * arg)
assert(sem_post(&s) == 0);
- return 0;
+ return NULL;
}
@@ -123,7 +123,7 @@ main()
int result2;
assert(pthread_create(&t, NULL, thr, NULL) == 0);
- assert(pthread_join(t, (void *)&result1) == 0);
+ assert(pthread_join(t, &result1) == 0);
assert((int)(size_t)result1 == 0);
assert(sem_init(&s, PTHREAD_PROCESS_PRIVATE, 0) == 0);
diff --git a/tests/semaphore4.c b/tests/semaphore4.c
index 0ccd45a..3a28c7b 100644
--- a/tests/semaphore4.c
+++ b/tests/semaphore4.c
@@ -111,7 +111,7 @@ main()
assert(pthread_cancel(t[50]) == 0);
{
void* result;
- assert(pthread_join(t[50], (void *) &result) == 0);
+ assert(pthread_join(t[50], &result) == 0);
}
assert(sem_getvalue(&s, &value) == 0);
assert(-value == (MAX_COUNT - 1));