android c++线程互斥类Condition
来源:互联网 发布:高分数据提取地物 编辑:程序博客网 时间:2024/06/14 08:22
/*
* Condition variable class. The implementation is system-dependent.
*
* Condition variables are paired up with mutexes. Lock the mutex,
* call wait(), then either re-wait() if things aren't quite what you want,
* or unlock the mutex and continue. All threads calling wait() must
* use the same mutex for a given Condition.
*/
class Condition {
public:
enum {
PRIVATE = 0,
SHARED = 1
};
Condition();
Condition(int type);
~Condition();
// Wait on the condition variable. Lock the mutex before calling.
status_t wait(Mutex& mutex);
// same with relative timeout
status_t waitRelative(Mutex& mutex, nsecs_t reltime);
// Signal the condition variable, allowing one thread to continue.
void signal();
// Signal the condition variable, allowing all threads to continue.
void broadcast();
private:
#if defined(HAVE_PTHREADS)
pthread_cond_t mCond;
#else
void* mState;
#endif
};
* Condition variable class. The implementation is system-dependent.
*
* Condition variables are paired up with mutexes. Lock the mutex,
* call wait(), then either re-wait() if things aren't quite what you want,
* or unlock the mutex and continue. All threads calling wait() must
* use the same mutex for a given Condition.
*/
class Condition {
public:
enum {
PRIVATE = 0,
SHARED = 1
};
Condition();
Condition(int type);
~Condition();
// Wait on the condition variable. Lock the mutex before calling.
status_t wait(Mutex& mutex);
// same with relative timeout
status_t waitRelative(Mutex& mutex, nsecs_t reltime);
// Signal the condition variable, allowing one thread to continue.
void signal();
// Signal the condition variable, allowing all threads to continue.
void broadcast();
private:
#if defined(HAVE_PTHREADS)
pthread_cond_t mCond;
#else
void* mState;
#endif
};
- android c++线程互斥类Condition
- 线程condition
- 11.4线程----Condition
- 11.4线程 Condition
- JDK5 condition线程通信
- Condition使用---线程通信
- Condition线程通信
- Condition 控制线程通信
- Windows Via C/C++:用户模式下的线程同步——Condition Variables 条件变量
- “J.U.C”:Condition
- 唤醒或等待线程 Condition
- 线程同步:Mutex和Condition
- java线程系列---condition例子
- 线程--条件变量Condition Variable
- java线程之Condition、ReentrantLock
- 使用Condition控制线程通信
- 线程并发工具--Lock&Condition
- 线程之间的通信Condition
- 关注C++细节--宏展开出错
- 第十回 JavaFX2.0单选框Radio Button
- ucos-ii 任务调度
- 1022(P116—126) for thinking in c++
- SVN cleanup 失败后的处理
- android c++线程互斥类Condition
- 知彼者知己:乔布斯对他的十个对手的评价
- Web应用乱码(1)__解决方案
- 第十一回 JavaFX2.0开关按钮ToggleButton
- 第十二回 JavaFX2.0 复选框CheckBox
- Direct3D资源管理(Management Best Practices)
- windows7系统内存管理--Superfetch
- 第十三回 JavaFX2.0 选项框ChoiceBox
- 我,依然爱着你。