mutex for sync of threads