#include "dnxTimer.h"
#include "dnxNebMain.h"
#include "dnxError.h"
#include "dnxDebug.h"
#include "dnxSrvProt.h"
#include "dnxJobList.h"
#include "dnxLogging.h"
#include "dnxSleep.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <assert.h>
Go to the source code of this file.
Data Structures | |
struct | iDnxTimer_ |
DNX job expiration timer implementation structure. More... | |
Defines | |
#define | DNX_DEF_TIMER_SLEEP 5000 |
#define | MAX_EXPIRED 10 |
Typedefs | |
typedef struct iDnxTimer_ | iDnxTimer |
DNX job expiration timer implementation structure. | |
Functions | |
static void | dnxTimerCleanup (void *data) |
Timer thread clean-up routine. | |
static void * | dnxTimer (void *data) |
The main timer thread procedure entry point. | |
int | dnxTimerCreate (DnxJobList *joblist, int sleeptime, DnxTimer **ptimer) |
Create a new job list expiration timer object. | |
void | dnxTimerDestroy (DnxTimer *timer) |
Destroy an existing job list expiration timer object. |
#define DNX_DEF_TIMER_SLEEP 5000 |
Default timer sleep interval.
Definition at line 54 of file dnxTimer.c.
#define MAX_EXPIRED 10 |
Maximum expired jobs during interval.
Definition at line 55 of file dnxTimer.c.
typedef struct iDnxTimer_ iDnxTimer |
DNX job expiration timer implementation structure.
static void* dnxTimer | ( | void * | data | ) | [static] |
The main timer thread procedure entry point.
[in] | data | - an opaque pointer to thread data for the timer thread. This is actually the dnx server global data object. |
Definition at line 92 of file dnxTimer.c.
References DnxNodeRequest::address, DnxNewJob::cmd, DNX_MAX_ADDRSTR, DNX_OK, dnxAuditJob(), dnxCancelableSleep(), dnxDebug(), dnxErrorString(), dnxJobCleanup(), dnxJobListExpire(), dnxLog(), dnxNtop(), dnxPostResult(), dnxTimerCleanup(), iDnxTimer_::joblist, MAX_EXPIRED, DnxXID::objSerial, DnxXID::objSlot, DnxNewJob::payload, DnxNewJob::pNode, iDnxTimer_::sleepms, DnxNewJob::start_time, and DnxNewJob::xid.
static void dnxTimerCleanup | ( | void * | data | ) | [static] |
Timer thread clean-up routine.
[in] | data | - an opaque pointer to thread data for the dying thread. |
Definition at line 77 of file dnxTimer.c.
int dnxTimerCreate | ( | DnxJobList * | joblist, | |
int | sleeptime, | |||
DnxTimer ** | ptimer | |||
) |
Create a new job list expiration timer object.
[in] | joblist | - the job list that should be expired by the timer. |
[in] | sleeptime | - time between expiration checks, in milliseconds. |
[out] | ptimer | - the address of storage for returning the new object reference. |
Definition at line 169 of file dnxTimer.c.
References DNX_DEF_TIMER_SLEEP, DNX_ERR_MEMORY, DNX_ERR_THREAD, DNX_OK, dnxErrorString(), dnxLog(), dnxTimer(), iDnxTimer_::joblist, iDnxTimer_::sleepms, iDnxTimer_::tid, xfree, and xmalloc.
void dnxTimerDestroy | ( | DnxTimer * | timer | ) |
Destroy an existing job list expiration timer object.
[in] | timer | - the timer object to be destroyed. |
Definition at line 203 of file dnxTimer.c.
References iDnxTimer_::tid, and xfree.