| 130 | } |
| 131 | |
| 132 | auto Mutex::IsLockedByCurrentTask() const -> bool { |
| 133 | auto current_task = TaskManagerSingleton::instance().GetCurrentTask(); |
| 134 | if (current_task == nullptr) { |
| 135 | return false; |
| 136 | } |
| 137 | |
| 138 | return locked_.load(std::memory_order_acquire) && |
| 139 | owner_.load(std::memory_order_acquire) == current_task->pid; |
| 140 | } |