lock mutex before starting threads
lock mutex before starting threads avoids threads begin to run before everything is set up