Revert mutex with flags and omit include pthread.h