[client] define locking types and semantics to allow for alt methods

This commit is contained in:
Geoffrey McRae
2017-12-21 00:57:27 +11:00
parent 2fe800f502
commit 2f6b7e08f8
2 changed files with 21 additions and 12 deletions

View File

@@ -44,4 +44,9 @@ static inline void nsleep(uint64_t ns)
.tv_nsec = ns - ((ns / 1e9) * 1e9)
};
nanosleep(&ts, NULL);
}
}
typedef volatile int LG_Lock;
#define LG_LOCK_INIT(x) (x) = 0
#define LG_LOCK(x) while(__sync_lock_test_and_set(&(x), 1))
#define LG_UNLOCK(x) __sync_lock_release(&this->mouseLock)