AbstractThread is a simplification of the existing MediaPromise code that guarantees that two events will not run at the same time - either because it's a single thread or because it's a task queue.