Implementing dynamic thread-safe event queue inside input manager