Add checkevent intrinsic to check if any resources owned by the current thread