Mercurial > sdl-ios-xcode
comparison src/thread/irix/SDL_syssem.c @ 2735:204be4fc2726
Final merge of Google Summer of Code 2008 work...
Port SDL 1.3 to the Nintendo DS
by Darren Alton, mentored by Sam Lantinga
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 27 Aug 2008 15:10:03 +0000 |
parents | c121d94672cb |
children | 99210400e8b9 |
comparison
equal
deleted
inserted
replaced
2734:dd25eabe441c | 2735:204be4fc2726 |
---|---|
53 */ | 53 */ |
54 | 54 |
55 static struct sembuf op_trywait[2] = { | 55 static struct sembuf op_trywait[2] = { |
56 {0, -1, (IPC_NOWAIT | SEM_UNDO)} /* Decrement semaphore, no block */ | 56 {0, -1, (IPC_NOWAIT | SEM_UNDO)} /* Decrement semaphore, no block */ |
57 }; | 57 }; |
58 | |
58 static struct sembuf op_wait[2] = { | 59 static struct sembuf op_wait[2] = { |
59 {0, -1, SEM_UNDO} /* Decrement semaphore */ | 60 {0, -1, SEM_UNDO} /* Decrement semaphore */ |
60 }; | 61 }; |
62 | |
61 static struct sembuf op_post[1] = { | 63 static struct sembuf op_post[1] = { |
62 {0, 1, (IPC_NOWAIT | SEM_UNDO)} /* Increment semaphore */ | 64 {0, 1, (IPC_NOWAIT | SEM_UNDO)} /* Increment semaphore */ |
63 }; | 65 }; |
64 | 66 |
65 /* Create a blockable semaphore */ | 67 /* Create a blockable semaphore */ |
168 retval = SDL_SemTryWait(sem); | 170 retval = SDL_SemTryWait(sem); |
169 if (retval == 0) { | 171 if (retval == 0) { |
170 break; | 172 break; |
171 } | 173 } |
172 SDL_Delay(1); | 174 SDL_Delay(1); |
173 } | 175 } while (SDL_GetTicks() < timeout); |
174 while (SDL_GetTicks() < timeout); | |
175 | 176 |
176 return retval; | 177 return retval; |
177 } | 178 } |
178 | 179 |
179 Uint32 | 180 Uint32 |