Lock, mutex, semaphore… what’s the difference?

http://stackoverflow.com/questions/2332765/lock-mutex-semaphore-whats-the-difference

Critical Section= User object used for allowing the execution of just one active thread from many others within one process. The other non selected threads are put to sleep.

Mutex Semaphore (aka Mutex)= Kernel object used for allowing the execution of just one active thread from many others, among different processes. The other non selected threads are put to sleep. This object supports thread ownership, thread termination notification, recursion (multiple ‘acquire’ calls from same thread) and ‘priority inversion avoidance’.

Counting Semaphore (aka Semaphore)= Kernel object used for allowing the execution of a group of active threads from many others. The other non selected threads are put to sleep.

Spin-lock (aka Spinlock)= A lock which uses busy waiting. (The acquiring of the lock is made by xchg or similar atomic operations).