Commit 0c850fd9 authored by Stefan Reif's avatar Stefan Reif

New timer implementation

parent bac78b89
Pipeline #2376 failed with stages
in 21 seconds
This diff is collapsed.
......@@ -6,28 +6,21 @@
#include "../util/futex.h"
#include "../util/list.h"
typedef void *prrtTimerTaskArg;
typedef void (*prrtTimerTaskFun)(prrtTimerTaskArg);
typedef struct timespec prrtTimerDate;
typedef struct prrtTimerTask {
void (*fun)(void *);
void *arg;
prrtTimerTaskFun fun;
prrtTimerTaskArg arg;
} PrrtTimerTask;
typedef struct prrtTimerListNode {
struct prrtTimerListNode *next;
struct timespec time;
PrrtTimerTask task;
} PrrtTimerListNode;
typedef struct prrtTimer {
pthread_t worker;
pthread_mutex_t lock;
PrrtTimerListNode *list;
atomic_uint wake;
unsigned long long resolution;
} PrrtTimer;
typedef struct prrtTimer PrrtTimer;
PrrtTimer *PrrtTimer_create(void);
PrrtTimer *PrrtTimer_create(unsigned int core);
void *PrrtTimer_submit(PrrtTimer *timer, struct timespec *time, const PrrtTimerTask *task);
int PrrtTimer_submit(PrrtTimer *timer, const prrtTimerDate *when, const PrrtTimerTask *what);
void PrrtTimer_end(PrrtTimer *timer);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment