我正在尝试在C++中实现测试和测试并设置功能。
根据C++原子标志查询状态的内容,我们无法检查标志的状态,那么有什么解决方法呢?
循环将像这样:
std::atomic_flag lock_stream = ATOMIC_FLAG_INIT;
void ttas_lock()
{
while(lock_Stream);
while(lock_stream.test_and_set());
return
}
错误:无法将“((ttas*)this)->ttas::lock_stream”从“std :: atomic_flag”转换为“bool” 在(lock_stream)期间