add thr_alarm lib
add thr_alarm test cases