Fixed Barrier test. First get the thread ID, then wait for the barrier to be reached.
This commit is contained in:
parent
41e7fdd95f
commit
0131e576b7
@ -11,15 +11,15 @@ static SYNCHRONIZATION_BARRIER g_Barrier;
|
|||||||
static void* test_synch_barrier_thread_func(void* arg)
|
static void* test_synch_barrier_thread_func(void* arg)
|
||||||
{
|
{
|
||||||
BOOL status;
|
BOOL status;
|
||||||
|
int count;
|
||||||
status = EnterSynchronizationBarrier(&g_Barrier, 0);
|
|
||||||
|
|
||||||
EnterCriticalSection(&g_Lock);
|
EnterCriticalSection(&g_Lock);
|
||||||
|
count = g_Count++;
|
||||||
printf("Thread #%d status: %s\n", g_Count++,
|
|
||||||
status ? "TRUE" : "FALSE");
|
|
||||||
|
|
||||||
LeaveCriticalSection(&g_Lock);
|
LeaveCriticalSection(&g_Lock);
|
||||||
|
status = EnterSynchronizationBarrier(&g_Barrier, 0);
|
||||||
|
|
||||||
|
printf("Thread #%d status: %s\n", count,
|
||||||
|
status ? "TRUE" : "FALSE");
|
||||||
|
|
||||||
if (status)
|
if (status)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user