> memcpy(&new_mutex, &old_mutex, sizeof(pthread_mutex_t))
Maybe - but maybe not.
At least it should be safe to copy PTHREAD_MUTEX_INITIALIZER, I guess?