mirror of
https://github.com/dborth/fceugx.git
synced 2024-11-01 06:55:05 +01:00
fix device thread sleep - keep one eye open!
This commit is contained in:
parent
59ec4a5c13
commit
b70826e4db
@ -84,10 +84,19 @@ HaltDeviceThread()
|
||||
* This checks our devices for changes (SD/USB removed) and
|
||||
* initializes the network in the background
|
||||
***************************************************************************/
|
||||
static int devsleep = 3*1000*1000;
|
||||
|
||||
static void *
|
||||
devicecallback (void *arg)
|
||||
{
|
||||
sleep(1);
|
||||
while(devsleep > 0)
|
||||
{
|
||||
if(deviceHalt)
|
||||
LWP_SuspendThread(devicethread);
|
||||
usleep(100);
|
||||
devsleep -= 100;
|
||||
}
|
||||
|
||||
while (1)
|
||||
{
|
||||
#ifdef HW_RVL
|
||||
@ -129,10 +138,15 @@ devicecallback (void *arg)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if(deviceHalt)
|
||||
LWP_SuspendThread(devicethread);
|
||||
else
|
||||
sleep(1); // suspend thread for 1 sec
|
||||
devsleep = 1000*1000; // 1 sec
|
||||
|
||||
while(devsleep > 0)
|
||||
{
|
||||
if(deviceHalt)
|
||||
LWP_SuspendThread(devicethread);
|
||||
usleep(100);
|
||||
devsleep -= 100;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user