Function unlock [src]

Releases the Mutex which was previously acquired with lock or tryLock. It is undefined behavior to unlock from a different thread that it was locked from.

Prototype

pub fn unlock(r: *Recursive) void

Parameters

r: *Recursive

Source

pub fn unlock(r: *Recursive) void { r.lock_count -= 1; if (r.lock_count == 0) { @atomicStore(std.Thread.Id, &r.thread_id, invalid_thread_id, .unordered); r.mutex.unlock(); } }