https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61333
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The reason why GCC on linux is better is because it uses the futex syscall to have better locking (lower overhead). See config/linux/{mutex,lock}.c. While on Darwin, it directly calls into pthread_mutex calls.