I couldn't find a definitive answer so this is the place.
Windows' EnterCriticalSection
acts in the way that I can lock it multiple times in the same thread, and I need to unlock it on the way out the exact number of times so it will get free.
What is the Linux equivalent? Does pthread mutex acts in the same way? Or is it multiple locks, single unlock...