I\'m working with an API that can only access its objects on the main thread, so I need to create a new thread to be used for my GUI and then swap back to the original threa