Mercurial > sdl-ios-xcode
comparison test/testsem.c @ 1659:14717b52abc0 SDL-1.3
Merge trunk-1.3-3
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 17 May 2006 08:18:28 +0000 |
parents | d5298e8f22b3 |
children | 782fd950bd46 c121d94672cb 99acf3d856cb |
comparison
equal
deleted
inserted
replaced
1658:e49147870aac | 1659:14717b52abc0 |
---|---|
11 #define NUM_THREADS 10 | 11 #define NUM_THREADS 10 |
12 | 12 |
13 static SDL_sem *sem; | 13 static SDL_sem *sem; |
14 int alive = 1; | 14 int alive = 1; |
15 | 15 |
16 int ThreadFunc(void *data) | 16 int SDLCALL ThreadFunc(void *data) |
17 { | 17 { |
18 int threadnum = (int)(uintptr_t)data; | 18 int threadnum = (int)(uintptr_t)data; |
19 while ( alive ) { | 19 while ( alive ) { |
20 SDL_SemWait(sem); | 20 SDL_SemWait(sem); |
21 fprintf(stderr, "Thread number %d has got the semaphore (value = %d)!\n", threadnum, SDL_SemValue(sem)); | 21 fprintf(stderr, "Thread number %d has got the semaphore (value = %d)!\n", threadnum, SDL_SemValue(sem)); |