while; range is now for; remove ++ and --

This commit is contained in:
Ginger Bill
2017-01-03 19:11:12 +00:00
parent a86896e4d3
commit 70d4ca00df
20 changed files with 280 additions and 436 deletions
+3 -3
View File
@@ -52,7 +52,7 @@ mutex_lock :: proc(m: ^Mutex) {
}
}
atomic.store32(^m.owner, thread_id);
m.recursion++;
m.recursion += 1;
}
mutex_try_lock :: proc(m: ^Mutex) -> bool {
thread_id := current_thread_id();
@@ -68,7 +68,7 @@ mutex_try_lock :: proc(m: ^Mutex) -> bool {
}
atomic.store32(^m.owner, thread_id);
}
m.recursion++;
m.recursion += 1;
return true;
}
mutex_unlock :: proc(m: ^Mutex) {
@@ -76,7 +76,7 @@ mutex_unlock :: proc(m: ^Mutex) {
thread_id := current_thread_id();
assert(thread_id == atomic.load32(^m.owner));
m.recursion--;
m.recursion -= 1;
recursion = m.recursion;
if recursion == 0 {
atomic.store32(^m.owner, thread_id);