Files
XCEngine/docs/api/threading/mutex/unlock-const.md
ssdfasd 5c3566774b docs: 更新 containers 和 threading 模块文档
- containers: 更新 string 类的多个方法文档
- threading: 更新 mutex 和 task-group 方法文档
2026-03-26 01:59:14 +08:00

35 lines
493 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Mutex::unlock
```cpp
void unlock() const;
```
释放互斥锁const 版本),允许其他等待中的线程获取该锁。
**参数:**
**返回:**
**线程安全:**
**复杂度:** O(1)
**示例:**
```cpp
#include "XCEngine/Threading/Mutex.h"
XCEngine::Threading::Mutex mtx;
std::vector<int> data;
void SafePush(int value) {
mtx.lock();
data.push_back(value);
mtx.unlock();
}
```
## 相关文档
- [Mutex 总览](mutex.md) - 返回类总览