Shutdown fix in housekeeper

In memory logging in blr_master
This commit is contained in:
Mark Riddoch
2014-09-26 12:36:59 +01:00
parent 06596a0bc3
commit 3430fc99d2
7 changed files with 100 additions and 16 deletions

View File

@ -42,6 +42,8 @@ static HKTASK *tasks = NULL;
*/
static SPINLOCK tasklock = SPINLOCK_INIT;
static int do_shutdown = 0;
static void hkthread(void *);
/**
@ -172,6 +174,8 @@ void *taskdata;
for (;;)
{
if (do_shutdown)
return;
thread_millisleep(1000);
now = time(0);
spinlock_acquire(&tasklock);
@ -194,3 +198,13 @@ void *taskdata;
spinlock_release(&tasklock);
}
}
/**
* Called to shutdown the housekeeper
*
*/
void
hkshutdown()
{
do_shutdown = 1;
}