diff options
author | rpj <rpj> | 2001-07-09 18:22:07 +0000 |
---|---|---|
committer | rpj <rpj> | 2001-07-09 18:22:07 +0000 |
commit | 1d99828acf48bc6d5a81aadc6123e5172dfc355d (patch) | |
tree | 4646ce8ba7129298e3ca6931c8e7019e9bbeb2df /implement.h | |
parent | f58aab44e671bb39b8afb29804a9ca94c238c523 (diff) |
* barrier.c: Revamped to fix the race condition. Two alternating
semaphores are used instead of the PulseEvent. Also improved
overall throughput by returning PTHREAD_BARRIER_SERIAL_THREAD
to the first waking thread.
* implement.h (pthread_barrier_t_): Revamped.
Diffstat (limited to 'implement.h')
-rw-r--r-- | implement.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/implement.h b/implement.h index 5b30d1a..bc72b3f 100644 --- a/implement.h +++ b/implement.h @@ -187,10 +187,12 @@ struct pthread_spinlock_t_ { }; struct pthread_barrier_t_ { - LONG nCurrentBarrierHeight; - LONG nInitialBarrierHeight; + unsigned int nCurrentBarrierHeight; + unsigned int nInitialBarrierHeight; + unsigned int nSerial; + int iStep; pthread_mutex_t mtxExclusiveAccess; - HANDLE eventBarrierBreeched; + sem_t semBarrierBreeched[2]; }; struct pthread_barrierattr_t_ { |