SDL_CreateSemaphore.3
资源名称:NETVIDEO.rar [点击查看]
上传用户:sun1608
上传日期:2007-02-02
资源大小:6116k
文件大小:1k
源码类别:
流媒体/Mpeg4/MP4
开发平台:
Visual C++
- .TH "SDL_CreateSemaphore" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference"
- .SH "NAME"
- SDL_CreateSemaphore- Creates a new semaphore and assigns an initial value to it&.
- .SH "SYNOPSIS"
- .PP
- fB#include "SDL&.h"
- #include "SDL_thread&.h"
- .sp
- fBSDL_sem *fBSDL_CreateSemaphorefPfR(fBUint32 initial_valuefR);
- .SH "DESCRIPTION"
- .PP
- fBSDL_CreateSemaphore()fP creates a new semaphore and initializes it with the value fBinitial_valuefR&. Each locking operation on the semaphore by fISDL_SemWaitfR, fISDL_SemTryWaitfR or fISDL_SemWaitTimeoutfR will atomically decrement the semaphore value&. The locking operation will be blocked if the semaphore value is not positive (greater than zero)&. Each unlock operation by fISDL_SemPostfR will atomically increment the semaphore value&.
- .SH "RETURN VALUE"
- .PP
- Returns a pointer to an initialized semaphore or fBNULLfR if there was an error&.
- .SH "EXAMPLES"
- .PP
- .PP
- .nf
- f(CWSDL_sem *my_sem;
- my_sem = SDL_CreateSemaphore(INITIAL_SEM_VALUE);
- if (my_sem == NULL) {
- return CREATE_SEM_FAILED;
- }fR
- .fi
- .PP
- .SH "SEE ALSO"
- .PP
- fIfBSDL_DestroySemaphorefPfR, fIfBSDL_SemWaitfPfR, fIfBSDL_SemTryWaitfPfR, fIfBSDL_SemWaitTimeoutfPfR, fIfBSDL_SemPostfPfR, fIfBSDL_SemValuefPfR
- ..." created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00