Low-core count race condition

Due to the use of atomics, certain race conditions occur when a lower priority thread acquires A, then de-schedules, and a real-time priority thread tries to acquire A. Since the real-time thread won't stop trying to acquire A until it is de-scheduled (which it will not be) we end up in a cpu-stuck state. This patch helps avoid a common occurence of this on low-core count machines. It does not resolve the underlying issue.