The docs on LockGuard states that its similar to MutexGuard's behacior, and this is a bit misleading, because MutexGuard holds the actual data such that it cant be accessed without the guard.
LockGuard is different from MutexGuard in that sense - there's no limitation on any data access enforced by this guard.
They are similar only in the aspect of Drop, in which they both release the lock.
The docs on
LockGuardstates that its similar toMutexGuard's behacior, and this is a bit misleading, becauseMutexGuardholds the actual data such that it cant be accessed without the guard.LockGuardis different fromMutexGuardin that sense - there's no limitation on any data access enforced by this guard.They are similar only in the aspect of
Drop, in which they both release the lock.