64 |
if(timeouts->next->time > 0) { |
if(timeouts->next->time > 0) { |
65 |
time = sys_arch_mbox_fetch(mbox, msg, timeouts->next->time); |
time = sys_arch_mbox_fetch(mbox, msg, timeouts->next->time); |
66 |
} else { |
} else { |
67 |
time = 0; |
time = 0xffffffff; |
68 |
} |
} |
69 |
|
|
70 |
if(time == 0) { |
if(time == 0xffffffff) { |
71 |
/* If time == 0, a timeout occured before a message could be |
/* If time == 0xffffffff, a timeout occured before a message could be |
72 |
fetched. We should now call the timeout handler and |
fetched. We should now call the timeout handler and |
73 |
deallocate the memory allocated for the timeout. */ |
deallocate the memory allocated for the timeout. */ |
74 |
tmptimeout = timeouts->next; |
tmptimeout = timeouts->next; |
84 |
/* We try again to fetch a message from the mbox. */ |
/* We try again to fetch a message from the mbox. */ |
85 |
goto again; |
goto again; |
86 |
} else { |
} else { |
87 |
/* If time > 0, a message was received before the timeout |
/* If time != 0xffffffff, a message was received before the timeout |
88 |
occured. The time variable is set to the number of |
occured. The time variable is set to the number of |
89 |
microseconds we waited for the message. */ |
milliseconds we waited for the message. */ |
90 |
if(time <= timeouts->next->time) { |
if(time <= timeouts->next->time) { |
91 |
timeouts->next->time -= time; |
timeouts->next->time -= time; |
92 |
} else { |
} else { |
119 |
if(timeouts->next->time > 0) { |
if(timeouts->next->time > 0) { |
120 |
time = sys_arch_sem_wait(sem, timeouts->next->time); |
time = sys_arch_sem_wait(sem, timeouts->next->time); |
121 |
} else { |
} else { |
122 |
time = 0; |
time = 0xffffffff; |
123 |
} |
} |
124 |
|
|
125 |
if(time == 0) { |
if(time == 0xffffffff) { |
126 |
/* If time == 0, a timeout occured before a message could be |
/* If time == 0xffffffff, a timeout occured before a message could be |
127 |
fetched. We should now call the timeout handler and |
fetched. We should now call the timeout handler and |
128 |
deallocate the memory allocated for the timeout. */ |
deallocate the memory allocated for the timeout. */ |
129 |
tmptimeout = timeouts->next; |
tmptimeout = timeouts->next; |
140 |
/* We try again to fetch a message from the mbox. */ |
/* We try again to fetch a message from the mbox. */ |
141 |
goto again; |
goto again; |
142 |
} else { |
} else { |
143 |
/* If time > 0, a message was received before the timeout |
/* If time != 0xffffffff, a message was received before the timeout |
144 |
occured. The time variable is set to the number of |
occured. The time variable is set to the number of |
145 |
microseconds we waited for the message. */ |
milliseconds we waited for the message. */ |
146 |
if(time <= timeouts->next->time) { |
if(time <= timeouts->next->time) { |
147 |
timeouts->next->time -= time; |
timeouts->next->time -= time; |
148 |
} else { |
} else { |