Put mutexes in exported functions.