3 ms·
I’m wondering if there is such a primitive like assert_lock() or similar, which will let me do that.
by alkonaut 4y ago
I’m wondering if there is such a primitive like assert_lock() or similar, which will let me do that.
- archagon 4y agoApple has one for `os_unfair_lock`: https://developer.apple.com/documentation/os/2976314-os_unfair_lock_assert_owner https://developer.apple.com/documentation/os/2976314-os_unfa...
- alkonaut 4y agoLooks like if (!Monitor.IsEntered(_x)) throw new InvalidOperation. Will do the trick in C#