Made managed event processing thread safe.