Mercurial > sdl-ios-xcode
annotate docs/man3/SDL_SemWait.3 @ 55:55f1f1b3e27d
Added new docs for SDL 1.2.1
author | Sam Lantinga <slouken@lokigames.com> |
---|---|
date | Sun, 10 Jun 2001 19:31:57 +0000 |
parents | 74212992fb08 |
children | e5bc29de3f0a |
rev | line source |
---|---|
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
1 .TH "SDL_SemWait" "3" "Sun 10 Jun 2001, 19:41" "SDL" "SDL API Reference" |
0 | 2 .SH "NAME" |
3 SDL_SemWait\- Lock a semaphore and suspend the thread if the semaphore value is zero\&. | |
4 .SH "SYNOPSIS" | |
5 .PP | |
6 \fB#include "SDL\&.h" | |
7 #include "SDL_thread\&.h" | |
8 .sp | |
9 \fBint \fBSDL_SemWait\fP\fR(\fBSDL_sem *sem\fR); | |
10 .SH "DESCRIPTION" | |
11 .PP | |
12 \fBSDL_SemWait()\fP suspends the calling thread until either the semaphore pointed to by \fBsem\fR has a positive value, the call is interrupted by a signal or error\&. If the call is successful it will atomically decrement the semaphore value\&. | |
13 .PP | |
14 After \fBSDL_SemWait()\fP is successful, the semaphore can be released and its count atomically incremented by a successful call to \fISDL_SemPost\fR\&. | |
15 .SH "RETURN VALUE" | |
16 .PP | |
17 Returns \fB0\fR if successful or \fB-1\fR if there was an error (leaving the semaphore unchanged)\&. | |
18 .SH "EXAMPLES" | |
19 .PP | |
20 .PP | |
21 .nf | |
22 \f(CWif (SDL_SemWait(my_sem) == -1) { | |
23 return WAIT_FAILED; | |
24 } | |
25 | |
26 \&.\&.\&. | |
27 | |
28 SDL_SemPost(my_sem);\fR | |
29 .fi | |
30 .PP | |
31 .SH "SEE ALSO" | |
32 .PP | |
33 \fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
34 ...\" created by instant / docbook-to-man, Sun 10 Jun 2001, 19:41 |