Annotated edit history of
SDL_SemWait(3) version 2, including all changes.
View license author blame.
Rev |
Author |
# |
Line |
2 |
perry |
1 |
SDL_!SemWait |
|
|
2 |
!!!SDL_!SemWait |
1 |
perry |
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
RETURN VALUE |
|
|
7 |
EXAMPLES |
|
|
8 |
SEE ALSO |
|
|
9 |
---- |
|
|
10 |
!!NAME |
|
|
11 |
|
|
|
12 |
|
2 |
perry |
13 |
SDL_!SemWait- Lock a semaphore and suspend the thread if the semaphore value is zero. |
1 |
perry |
14 |
!!SYNOPSIS |
|
|
15 |
|
|
|
16 |
|
|
|
17 |
__#include |
|
|
18 |
__ |
|
|
19 |
|
|
|
20 |
|
2 |
perry |
21 |
__int SDL_!SemWait__(__SDL_sem *sem__); |
1 |
perry |
22 |
!!DESCRIPTION |
|
|
23 |
|
|
|
24 |
|
2 |
perry |
25 |
__SDL_!SemWait()__ suspends the calling thread until |
1 |
perry |
26 |
either the semaphore pointed to by __sem__ has a positive |
|
|
27 |
value, the call is interrupted by a signal or error. If the |
|
|
28 |
call is successful it will atomically decrement the |
|
|
29 |
semaphore value. |
|
|
30 |
|
|
|
31 |
|
2 |
perry |
32 |
After __SDL_!SemWait()__ is successful, the semaphore can |
1 |
perry |
33 |
be released and its count atomically incremented by a |
2 |
perry |
34 |
successful call to ''SDL_!SemPost''. |
1 |
perry |
35 |
!!RETURN VALUE |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
Returns __0__ if successful or __-1__ if there was an |
|
|
39 |
error (leaving the semaphore unchanged). |
|
|
40 |
!!EXAMPLES |
|
|
41 |
|
|
|
42 |
|
2 |
perry |
43 |
if (SDL_!SemWait(my_sem) == -1) { |
1 |
perry |
44 |
return WAIT_FAILED; |
|
|
45 |
} |
|
|
46 |
... |
2 |
perry |
47 |
SDL_!SemPost(my_sem); |
1 |
perry |
48 |
!!SEE ALSO |
|
|
49 |
|
|
|
50 |
|
2 |
perry |
51 |
__SDL_!CreateSemaphore__, __SDL_!DestroySemaphore__, |
|
|
52 |
__SDL_!SemTryWait__, __SDL_!SemWaitTimeout__, |
|
|
53 |
__SDL_!SemPost__, __SDL_!SemValue__ |
1 |
perry |
54 |
---- |
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.