| author | |
| committer | |
| log | 584b062a302ca10ecab4488a473440db7173bb2a |
| tree | a41bb1345bafba3d06675d5cfa4c5a5474bfdef1 |
| parent | a8a2f2b58bd6f876258bb01b370a66c31d82f330 |
| signature |
Additionally we add RwLock to Thread.zig's list of tests2 files changed, 6 insertions(+), 1 deletions(-)
lib/std/Thread.zig+1| ... | @@ -1438,6 +1438,7 @@ test { | ... | @@ -1438,6 +1438,7 @@ test { |
| 1438 | _ = Mutex; | 1438 | _ = Mutex; |
| 1439 | _ = Semaphore; | 1439 | _ = Semaphore; |
| 1440 | _ = Condition; | 1440 | _ = Condition; |
| 1441 | _ = RwLock; | ||
| 1441 | } | 1442 | } |
| 1442 | 1443 | ||
| 1443 | fn testIncrementNotify(value: *usize, event: *ResetEvent) void { | 1444 | fn testIncrementNotify(value: *usize, event: *ResetEvent) void { |
lib/std/Thread/RwLock.zig+5-1| ... | @@ -95,7 +95,11 @@ pub const SingleThreadedRwLock = struct { | ... | @@ -95,7 +95,11 @@ pub const SingleThreadedRwLock = struct { |
| 95 | rwl.shared_count = 1; | 95 | rwl.shared_count = 1; |
| 96 | return true; | 96 | return true; |
| 97 | }, | 97 | }, |
| 98 | .locked_exclusive, .locked_shared => return false, | 98 | .locked_shared => { |
| 99 | rwl.shared_count += 1; | ||
| 100 | return true; | ||
| 101 | }, | ||
| 102 | .locked_exclusive => return false, | ||
| 99 | } | 103 | } |
| 100 | } | 104 | } |
| 101 | 105 |