Update thread.h

Implemented alarm + priority scheduling