summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorrpj <rpj>2005-05-17 16:04:07 +0000
committerrpj <rpj>2005-05-17 16:04:07 +0000
commit8d02bd1e36ce8ddf7dd99af9af4123bb32e35a44 (patch)
tree4745b238f21ba368634a06af55c3a1fc3fd1c675 /tests
parenta824c43d3f20fc5722c5fd8f0f942f632b961723 (diff)
''
Diffstat (limited to 'tests')
-rw-r--r--tests/reuse2.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/tests/reuse2.c b/tests/reuse2.c
index e573a31..c4db811 100644
--- a/tests/reuse2.c
+++ b/tests/reuse2.c
@@ -84,27 +84,15 @@ enum {
};
-static int dummy = 19;
static long done = 0;
void * func(void * arg)
{
- int i;
- int j;
-
sched_yield();
- for (i = 1; i < 10000; i++)
- {
- if (i * dummy % dummy == 0)
- {
- j = dummy;
- }
- }
-
InterlockedIncrement(&done);
- return (void *) j;
+ return (void *) 0;
}
int
@@ -126,7 +114,7 @@ main()
assert(pthread_create(&t[i], &attr, func, NULL) == 0);
}
- while (NUMTHREADS > done)
+ while (NUMTHREADS > InterlockedExchangeAdd((LPLONG)&done, 0L))
Sleep(100);
Sleep(100);