diff options
| author | Botahamec <botahamec@outlook.com> | 2025-01-05 18:23:10 -0500 |
|---|---|---|
| committer | Botahamec <botahamec@outlook.com> | 2025-01-05 18:23:10 -0500 |
| commit | 51dd003f176f649cee297f35d11fc01236cf9120 (patch) | |
| tree | 2d9bf1a920e7193e92575891a907260dc68f212f /src | |
| parent | f58290755204ce62c528ffbf5db0bb5ca3315949 (diff) | |
Make ThreadKey Sync
Diffstat (limited to 'src')
| -rw-r--r-- | src/key.rs | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -39,6 +39,10 @@ unsafe impl Keyable for ThreadKey {} // the ThreadKey can't be moved while a mutable reference to it exists unsafe impl Keyable for &mut ThreadKey {} +// Implementing this means we can allow `MutexGuard` to be Sync +// Safety: a &ThreadKey is useless by design. +unsafe impl Sync for ThreadKey {} + impl Debug for ThreadKey { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "ThreadKey") |
