Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 11 lines (8 sloc) 0.255 kb
1 2 3 4 5 6 7 8 9 10
#include "util/atomic.hpp"
#include "util/spinlock.hpp"

void rbx_spinlock_lock(int* lock) {
  while(!atomic::compare_and_swap(lock, RBX_SPINLOCK_UNLOCKED, RBX_SPINLOCK_LOCKED));
}

void rbx_spinlock_unlock(int* lock) {
  *lock = RBX_SPINLOCK_UNLOCKED;
}
Something went wrong with that request. Please try again.