pass alarm-priority

Add compare_thread_priority() in thread.c
Add sort(&ready_list, compare…, NULL) in next_thread_to_run()
By Wei Fang