/[lwip]/lwip/src/core/sys.c
ViewVC logotype

Diff of /lwip/src/core/sys.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by jani, Fri Feb 21 16:43:46 2003 UTC revision 1.9 by davidhaas, Fri Mar 28 20:46:40 2003 UTC
# Line 64  sys_mbox_fetch(sys_mbox_t mbox, void **m Line 64  sys_mbox_fetch(sys_mbox_t mbox, void **m
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;
# Line 84  sys_mbox_fetch(sys_mbox_t mbox, void **m Line 84  sys_mbox_fetch(sys_mbox_t mbox, void **m
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 {
# Line 119  sys_sem_wait(sys_sem_t sem) Line 119  sys_sem_wait(sys_sem_t sem)
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;
# Line 140  sys_sem_wait(sys_sem_t sem) Line 140  sys_sem_wait(sys_sem_t sem)
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 {

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26