From 0131e576b7c7d93055f7d2c71faac23d22044df2 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 2 Sep 2014 10:20:12 +0200 Subject: [PATCH] Fixed Barrier test. First get the thread ID, then wait for the barrier to be reached. --- winpr/libwinpr/synch/test/TestSynchBarrier.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/winpr/libwinpr/synch/test/TestSynchBarrier.c b/winpr/libwinpr/synch/test/TestSynchBarrier.c index ebdcc7c6e..6b2258016 100644 --- a/winpr/libwinpr/synch/test/TestSynchBarrier.c +++ b/winpr/libwinpr/synch/test/TestSynchBarrier.c @@ -11,15 +11,15 @@ static SYNCHRONIZATION_BARRIER g_Barrier; static void* test_synch_barrier_thread_func(void* arg) { BOOL status; - - status = EnterSynchronizationBarrier(&g_Barrier, 0); + int count; EnterCriticalSection(&g_Lock); - - printf("Thread #%d status: %s\n", g_Count++, - status ? "TRUE" : "FALSE"); - + count = g_Count++; LeaveCriticalSection(&g_Lock); + status = EnterSynchronizationBarrier(&g_Barrier, 0); + + printf("Thread #%d status: %s\n", count, + status ? "TRUE" : "FALSE"); if (status) {