Allegro already has code for mutexes. I can guarantee you they will refuse to incorporate a fix that half-works on only some platforms, instead of using their own mutex implementation for some reason.