Then again, you cannot use the ampersand operator with pthread_mutex_lock() (and generally with low-level locks and atomics). This is a programming error that everybody makes. See this, this and this .
As @tclementdev correctly points out, you cannot store a pthread_mutext_t in a var and then use the ampersand operator to pass it by pointer. Specifically, it is possible that the pthread_mutex_t is not a reference to the mutex but instead is the mutex, and so must have a stable memory location (such that multiple threads can access it). This cannot be achieved in safe Swift.