R/W semaphores implemented using ARM atomic functions