[APU] Move XmaContext::Block() to base class with RAII locking
This commit is contained in:
@@ -122,17 +122,6 @@ void XmaContextMaster::Enable() {
|
||||
set_is_enabled(true);
|
||||
}
|
||||
|
||||
bool XmaContextMaster::Block(bool poll) {
|
||||
if (!lock_.try_lock()) {
|
||||
if (poll) {
|
||||
return false;
|
||||
}
|
||||
lock_.lock();
|
||||
}
|
||||
lock_.unlock();
|
||||
return true;
|
||||
}
|
||||
|
||||
void XmaContextMaster::Clear() {
|
||||
std::lock_guard<xe_mutex> lock(lock_);
|
||||
XELOGAPU("XmaContext: reset context {}", id());
|
||||
|
||||
Reference in New Issue
Block a user