Sebastian Lackner : kernel32/tests: Remove unnecessary busy loop ( PVS-Studio).

Alexandre Julliard julliard at wine.codeweavers.com
Wed Oct 21 10:39:58 CDT 2015


Module: wine
Branch: master
Commit: 646888ec79574c5a80a2aaf9c5e5ad871fa580f7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=646888ec79574c5a80a2aaf9c5e5ad871fa580f7

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Tue Oct 20 21:55:41 2015 +0200

kernel32/tests: Remove unnecessary busy loop (PVS-Studio).

Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/tests/thread.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c
index b366661..e0de3f9 100644
--- a/dlls/kernel32/tests/thread.c
+++ b/dlls/kernel32/tests/thread.c
@@ -227,9 +227,8 @@ static DWORD WINAPI threadFunc1(LPVOID p)
 /* Double check that all threads really did run by validating that
    they have all written to the shared memory. There should be no race
    here, since all threads were synchronized after the write.*/
-   for(i=0;i<NUM_THREADS;i++) {
-     while(tstruct->threadmem[i]==0) ;
-   }
+   for (i = 0; i < NUM_THREADS; i++)
+      ok(tstruct->threadmem[i] != 0, "expected threadmem[%d] != 0\n", i);
 
    /* lstrlenA contains an exception handler so this makes sure exceptions work in threads */
    ok( lstrlenA( (char *)0xdeadbeef ) == 0, "lstrlenA: unexpected success\n" );




More information about the wine-cvs mailing list