https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71684
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> --- Yes, that firces the use of pthread_mutex_create and pthread_mutex_destroy, which gives the OS a chance to free memory on destroy. I don't recall what happened with FreeBSD, I think they moved away from allocating in pthread_mutex_lock but I might be wrong.