implemented Thread and Event for Linux