提交 58756573 编写于 作者: M Mara Bos

Fix comment about non-reentrant StaticMutex::lock().

The comment said it's UB to call lock() while it is locked. That'd be
quite a useless Mutex. :) It was supposed to say 'locked by the same
thread', not just 'locked'.
上级 31e4087b
......@@ -28,8 +28,9 @@ pub const fn new() -> Self {
/// Calls raw_lock() and then returns an RAII guard to guarantee the mutex
/// will be unlocked.
///
/// It is undefined behaviour to call this function while locked, or if the
/// mutex has been moved since the last time this was called.
/// It is undefined behaviour to call this function while locked by the
/// same thread, or if the mutex has been moved since the last time this
/// was called.
#[inline]
pub unsafe fn lock(&self) -> StaticMutexGuard<'_> {
self.0.lock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册