use pthread mutex and PTHREAD_MUTEX_INITIALIZER for static mutex