There are already lots of well-known and popular libraries out there that provide mutices. But I wanted to try implementing it myself for the sake of just making it. Hey, it’s summer session at DigiPen and I don’t have to work on any school game projects. This means I can do whatever programming exercise I want during this time
My implementation relies on “Windows.h”, which already provides mutex objects. But hey, it’s summer session! Besides, I actually find my interface design more intuitive and easier to use, so I might end up using it in my next game project.
Below is the interface for the Mutex class. It has a default constructor, a copy constructor and a destructor. It also has an assignment operator. Finally, it defines the very two operations a mutex object has: lock and unlock.










