12#include <timer_alarm.h>
16static u64 WaitSemaEx_callback(s32
id, u64 scheduled_time, u64 actual_time,
void *arg,
void *pc_value)
22 iReleaseWaitThread((s32)arg);
27s32 WaitSemaEx(s32 semaid,
int signal, u64 *timeout)
40 if (timeout != NULL && *timeout == 0)
42 ret = PollSema(semaid);
52 timerid = SetTimerAlarm(USec2TimerBusClock(*timeout), &WaitSemaEx_callback, (
void *)GetThreadId());
55 ret = WaitSema(semaid);
59 ReleaseTimerAlarm(timerid);