Chinaunix首页 | 论坛 | 博客
  • 博客访问: 596652
  • 博文数量: 1958
  • 博客积分: 44693
  • 博客等级: 大将
  • 技术积分: 22125
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-29 15:19
文章分类

全部博文(1958)

文章存档

2012年(560)

2011年(1398)

分类: LINUX

2011-03-16 17:43:01

SDL_CondWait 等待一个条件变量

Name

SDL_CondWait -- Wait on a condition variable

Synopsis

#include "SDL.h" #include "SDL_thread.h" int SDL_CondWait(SDL_cond *cond, SDL_mutex *mut);

Description

Unlock the provided mutex and wait for another thread to call  or  on the condition variable cond, then re-lock the mutex and return. The mutex must be locked before entering this function. Returns 0 when it is signalled, or -1 on an error.

解锁传递来的mutex,等待其他的线程调用 or  设置条件变量 cond。然后解锁mutex,并返回。

mutex是在进入SDL_ConWait之前就被锁定的。

SDL_ConWait被signalled,那么返回0,代表成功。否则返回-1或者其他 ,代表出错。

See Also
阅读(1407) | 评论(0) | 转发(1) |
0

上一篇:pthread在啥地方实现的呢?

下一篇:SDL_Event

给主人留下些什么吧!~~