[threads] bug in thread info structure. Small but important change
[tools] gdb debugging flag added to cflags
[arch] Added functions to mask out interrupts. Need to think a bit about how to use them, though...