clock: add @mainthread decorator