update eventcalls.h and eventcalls.c

implement lock on wait queue for each event.
discard wait_stage and condition checking.
Merge remote-tracking branch 'upstream/master'