SDL_SemWait.3
上传用户:sun1608
上传日期:2007-02-02
资源大小:6116k
文件大小:1k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. .TH "SDL_SemWait" "3" "Tue 11 Sep 2001, 23:00" "SDL" "SDL API Reference" 
  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_SemWaitfPfR(fBSDL_sem *semfR);
  10. .SH "DESCRIPTION"
  11. .PP
  12. 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&.
  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_SemPostfR&.
  15. .SH "RETURN VALUE"
  16. .PP
  17. Returns fB0fR if successful or fB-1fR 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. SDL_SemPost(my_sem);fR
  27. .fi
  28. .PP
  29. .SH "SEE ALSO"
  30. .PP
  31. fIfBSDL_CreateSemaphorefPfR, fIfBSDL_DestroySemaphorefPfR, fIfBSDL_SemTryWaitfPfR, fIfBSDL_SemWaitTimeoutfPfR, fIfBSDL_SemPostfPfR, fIfBSDL_SemValuefPfR
  32. ..." created by instant / docbook-to-man, Tue 11 Sep 2001, 23:00