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'.
This commit is contained in:
Mara Bos 2020-10-07 14:06:17 +02:00
parent 31e4087b90
commit 58756573fc

View File

@ -28,8 +28,9 @@ impl StaticMutex {
/// 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();