blob: 6c2edfeadb61d92c069ae3c5cf6ea73f96ecbbd4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
const std = @import("std");
pub fn Shared(T: type) type {
return struct {
value: T,
rw_lock: *std.Thread.RwLock,
pub fn unlock(self: *@This()) void {
self.rw_lock.unlockShared();
self.* = undefined;
}
};
}
|