The articles code for mutex_lock is this
mutex_lock(unsigned int mutex)
{
while (!cmpxchg(&mutex, UNLOCKED, LOCKED))
futex(&mutex, FUTEX_WAIT, LOCKED);
}
Now consider what happens if someone calls it volatile unsigned int my_mutex = UNLOCKED;
mutex_lock(my_mutex);
...
mutex_unlock(my_mutex);
my_mutex is copied into the mutex parameter. The mutex parameter is updated to locked. mutex_lock exits, which destroys the mutex variable. my_mutex still has the variable UNLOCKED.