SDL_SemWait.3
资源名称:NETVIDEO.rar [点击查看]
上传用户:sun1608
上传日期:2007-02-02
资源大小:6116k
文件大小:1k
源码类别:
流媒体/Mpeg4/MP4
开发平台:
Visual C++
- .TH "SDL_SemWait" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
- .SH "NAME"
- SDL_SemWait- Lock a semaphore and suspend the thread if the semaphore value is zero&.
- .SH "SYNOPSIS"
- .PP
- fB#include "SDL&.h"
- #include "SDL_thread&.h"
- .sp
- fBint fBSDL_SemWaitfPfR(fBSDL_sem *semfR);
- .SH "DESCRIPTION"
- .PP
- fBSDL_SemWait()fP suspends the calling thread until either the semaphore pointed to by fBsemfR 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&.
- .PP
- After fBSDL_SemWait()fP is successful, the semaphore can be released and its count atomically incremented by a successful call to fISDL_SemPostfR&.
- .SH "RETURN VALUE"
- .PP
- Returns fB0fR if successful or fB-1fR if there was an error (leaving the semaphore unchanged)&.
- .SH "EXAMPLES"
- .PP
- .PP
- .nf
- f(CWif (SDL_SemWait(my_sem) == -1) {
- return WAIT_FAILED;
- }
- &.&.&.
- SDL_SemPost(my_sem);fR
- .fi
- .PP
- .SH "SEE ALSO"
- .PP
- fIfBSDL_CreateSemaphorefPfR, fIfBSDL_DestroySemaphorefPfR, fIfBSDL_SemTryWaitfPfR, fIfBSDL_SemWaitTimeoutfPfR, fIfBSDL_SemPostfPfR, fIfBSDL_SemValuefPfR
- ..." created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00