diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2003-03-25 19:00:35 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2003-03-25 19:00:35 +0000 |
commit | 26cdc2aff41927292e2b68201c345d6ff75d3721 (patch) | |
tree | 2cfed0f83211ba2d7c0042b8841383c7e181fcff /cpukit/libnetworking/rtems/rtems_glue.c | |
parent | 2003-03-25 Thomas Doerfler <Thomas.Doerfler@imd-systems.de> (diff) | |
download | rtems-26cdc2aff41927292e2b68201c345d6ff75d3721.tar.bz2 |
2002-03-25 Eric Norum <norume@aps.anl.gov>
PR 374/networking
* Makefile.am, rtems/rtems_bsdnet.h, rtems/rtems_glue.c:
The patch sent as part of PR270 got applied to the wrong place.
The effect was that (1) startup was no faster than before and
(2) malloc starvation messages came way too quickly. The attached
patch fixes both these problems and also provides a mechanism for
applications to handle malloc starvation conditions as they see fit.
* rtems/rtems_bsdnet_malloc_starvation.c: New file.
Diffstat (limited to 'cpukit/libnetworking/rtems/rtems_glue.c')
-rw-r--r-- | cpukit/libnetworking/rtems/rtems_glue.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cpukit/libnetworking/rtems/rtems_glue.c b/cpukit/libnetworking/rtems/rtems_glue.c index 4ed1455cff..d1aad32023 100644 --- a/cpukit/libnetworking/rtems/rtems_glue.c +++ b/cpukit/libnetworking/rtems/rtems_glue.c @@ -117,11 +117,10 @@ rtems_bsdnet_malloc (unsigned long size, int type, int flags) return p; rtems_bsdnet_semaphore_release (); if (++try >= 30) { - printf ("rtems_bsdnet_malloc still waiting.\n"); + rtems_bsdnet_malloc_starvation(); try = 0; } - while (rtems_bsdnet_seconds_since_boot() == 0) - rtems_task_wake_after(1); + rtems_task_wake_after (rtems_bsdnet_ticks_per_second); rtems_bsdnet_semaphore_obtain (); } } @@ -272,7 +271,8 @@ rtems_bsdnet_initialize (void) /* * Ensure that `seconds' is greater than 0 */ - rtems_task_wake_after (rtems_bsdnet_ticks_per_second); + while (rtems_bsdnet_seconds_since_boot() == 0) + rtems_task_wake_after(1); /* * Set up BSD-style sockets |