Tiny cross-platform thread functions wrapper