summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9cb8aab)
In this way we are sure the compiler will not perform optimizations or
instruction reordering: so that the return from event is always done
after the execution of the corresponding event_do().
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4480
38d2e660-2303-0410-9eaa-
f027e97ec537
*/
INLINE bool event_waitTimeout(Event *e, ticks_t timeout)
{
*/
INLINE bool event_waitTimeout(Event *e, ticks_t timeout)
{
#if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
e->Ev.Sig.sig_proc = proc_current();
#if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
e->Ev.Sig.sig_proc = proc_current();
- return (sig_waitTimeout(e->Ev.Sig.sig_bit, timeout) & SIG_TIMEOUT) ?
+ ret = (sig_waitTimeout(e->Ev.Sig.sig_bit, timeout) & SIG_TIMEOUT) ?
false : true;
#else
ticks_t end = timer_clock() + timeout;
false : true;
#else
ticks_t end = timer_clock() + timeout;
while ((ACCESS_SAFE(e->Ev.Gen.completed) == false) ||
TIMER_AFTER(timer_clock(), end))
cpu_relax();
ret = e->Ev.Gen.completed;
e->Ev.Gen.completed = false;
while ((ACCESS_SAFE(e->Ev.Gen.completed) == false) ||
TIMER_AFTER(timer_clock(), end))
cpu_relax();
ret = e->Ev.Gen.completed;
e->Ev.Gen.completed = false;
}
#endif /* CONFIG_TIMER_EVENTS */
}
#endif /* CONFIG_TIMER_EVENTS */