/[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.9.2.1 by likewise, Wed May 14 14:38:28 2003 UTC revision 1.9.2.2 by likewise, Wed Jun 4 10:30:00 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 = 0xffffffff;        time = SYS_ARCH_TIMEOUT;
68      }      }
69    
70      if (time == 0xffffffff) {      if (time == 0xffffffff) {
# 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 != 0xffffffff, a message was received before the timeout        /* If time != SYS_ARCH_TIMEOUT, 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           milliseconds we waited for the message. */           milliseconds we waited for the message. */
90        if (time <= timeouts->next->time) {        if (time <= timeouts->next->time) {
# 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 = 0xffffffff;        time = SYS_ARCH_TIMEOUT;
123      }      }
124    
125      if (time == 0xffffffff) {      if (time == SYS_ARCH_TIMEOUT) {
126        /* If time == 0xffffffff, a timeout occured before a message could be        /* If time == SYS_ARCH_TIMEOUT, a timeout occured before a message
127           fetched. We should now call the timeout handler and           could be 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;
130        timeouts->next = tmptimeout->next;        timeouts->next = tmptimeout->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 != 0xffffffff, a message was received before the timeout        /* If time != SYS_ARCH_TIMEOUT, 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           milliseconds we waited for the message. */           milliseconds we waited for the message. */
146        if (time <= timeouts->next->time) {        if (time <= timeouts->next->time) {
# Line 279  sys_sem_wait_timeout(sys_sem_t sem, u32_ Line 279  sys_sem_wait_timeout(sys_sem_t sem, u32_
279  }  }
280    
281  /*-----------------------------------------------------------------------------------*/  /*-----------------------------------------------------------------------------------*/
282    void
283    sys_msleep(u32_t ms)
284    {
285            sys_sem_t delaysem = sys_sem_new(0);
286    
287            sys_sem_wait_timeout(delaysem, ms);
288    
289            sys_sem_free(delaysem);
290    }
291    /*-----------------------------------------------------------------------------------*/
292    
293  #endif /* NO_SYS */  #endif /* NO_SYS */

Legend:
Removed from v.1.9.2.1  
changed lines
  Added in v.1.9.2.2

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