Change var decl syntax

`var x int;` from `x: int;`
This commit is contained in:
Ginger Bill
2016-12-18 22:32:18 +00:00
parent 4c10fbdcd4
commit 77e219d442
12 changed files with 342 additions and 342 deletions
+5 -5
View File
@@ -46,7 +46,7 @@ proc mutex_destroy(m ^Mutex) {
semaphore_destroy(^m.semaphore);
}
proc mutex_lock(m ^Mutex) {
thread_id := current_thread_id();
var thread_id = current_thread_id();
if atomic.fetch_add32(^m.counter, 1) > 0 {
if thread_id != atomic.load32(^m.owner) {
semaphore_wait(^m.semaphore);
@@ -56,11 +56,11 @@ proc mutex_lock(m ^Mutex) {
m.recursion++;
}
proc mutex_try_lock(m ^Mutex) -> bool {
thread_id := current_thread_id();
var thread_id = current_thread_id();
if atomic.load32(^m.owner) == thread_id {
atomic.fetch_add32(^m.counter, 1);
} else {
expected: i32 = 0;
var expected i32 = 0;
if atomic.load32(^m.counter) != 0 {
return false;
}
@@ -73,8 +73,8 @@ proc mutex_try_lock(m ^Mutex) -> bool {
return true;
}
proc mutex_unlock(m ^Mutex) {
recursion: i32;
thread_id := current_thread_id();
var recursion i32;
var thread_id = current_thread_id();
assert(thread_id == atomic.load32(^m.owner));
m.recursion--;