本文整理汇总了C++中Mutex::IsLockedByCurrent方法的典型用法代码示例。如果您正苦于以下问题:C++ Mutex::IsLockedByCurrent方法的具体用法?C++ Mutex::IsLockedByCurrent怎么用?C++ Mutex::IsLockedByCurrent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mutex
的用法示例。
在下文中一共展示了Mutex::IsLockedByCurrent方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TriggerDone
void TriggerDone() {
assert(mutex.IsLockedByCurrent());
cond.signal();
}
示例2: TriggerCommand
void TriggerCommand() {
assert(mutex.IsLockedByCurrent());
cond.signal();
}
示例3: Stop
/**
* Stop the thread synchronously.
*
* Caller must lock the mutex.
*/
void Stop() {
assert(mutex.IsLockedByCurrent());
StopAsync();
WaitStopped();
}
示例4: IsStopped
/**
* Was the thread asked to stop? The Tick() implementation should
* use this to check whether to cancel the operation.
*
* Caller must lock the mutex.
*/
gcc_pure
bool IsStopped() const {
assert(mutex.IsLockedByCurrent());
return stop;
}
示例5: IsBusy
/**
* Is the thread currently working (i.e. inside Tick())?
*
* Caller must lock the mutex.
*/
gcc_pure
bool IsBusy() const {
assert(mutex.IsLockedByCurrent());
return pending || busy;
}
示例6: end
const_iterator end() const {
assert(mutex.IsLockedByCurrent());
return const_iterator(nullptr);
}
示例7: begin
const_iterator begin() const {
assert(mutex.IsLockedByCurrent());
return const_iterator(first);
}
示例8: assert
const Serial &GetSerial() const {
assert(mutex.IsLockedByCurrent());
return serial;
}