Added thread locking so two threads cannot access Dionysus at one time