core: thread: use disableIRQ/restoreIRQ

unsigned