Initial implementation of the monitor modules and a simple mysql monitor to set

server up or down automatically.
This commit is contained in:
Mark Riddoch
2013-07-08 18:55:43 +02:00
parent 902e059342
commit 46f6d27b0b
15 changed files with 632 additions and 1 deletions

View File

@ -61,3 +61,18 @@ void *rval;
pthread_join((pthread_t)thd, &rval);
}
/**
* Put the thread to sleep for a number of milliseconds
*
* @param ms Number of milliseconds to sleep
*/
void
thread_millisleep(int ms)
{
struct timespec req;
req.tv_sec = ms / 1000;
req.tv_nsec = (ms % 1000) * 1000000;
nanosleep(&req, NULL);
}