CreateMutex
creates a 'recursive' mutex, i.e. the mutex can be acquired repeatedly by the same thread. Another thread would not be able to acquire it. And that makes perfect sense.
If you need to create a non-recursive mutex, use CreateSemaphore
instead.