Using EventQueue to mediate access to shared resources between multiple threads [1]