fix device thread sleep - keep one eye open!

This commit is contained in:
dborth 2009-05-26 21:48:12 +00:00
parent 92075a1fbf
commit cde243eff5

View File

@ -87,10 +87,19 @@ HaltDeviceThread()
* This checks our devices for changes (SD/USB removed) and * This checks our devices for changes (SD/USB removed) and
* initializes the network in the background * initializes the network in the background
***************************************************************************/ ***************************************************************************/
static int devsleep = 3*1000*1000;
static void * static void *
devicecallback (void *arg) devicecallback (void *arg)
{ {
sleep(1); while(devsleep > 0)
{
if(deviceHalt)
LWP_SuspendThread(devicethread);
usleep(100);
devsleep -= 100;
}
while (1) while (1)
{ {
#ifdef HW_RVL #ifdef HW_RVL
@ -132,10 +141,15 @@ devicecallback (void *arg)
} }
} }
#endif #endif
devsleep = 1000*1000; // 1 sec
while(devsleep > 0)
{
if(deviceHalt) if(deviceHalt)
LWP_SuspendThread(devicethread); LWP_SuspendThread(devicethread);
else usleep(100);
sleep(1); // suspend thread for 1 sec devsleep -= 100;
}
} }
return NULL; return NULL;
} }