Detail the mechanics of semaphores, mutexes, and spinlocks, and when to use each in embedded systems.