23 lines
426 B
C++
23 lines
426 B
C++
#pragma once
|
|
#include <bits/signal.h>
|
|
#include <luna/LinkedList.h>
|
|
|
|
struct Thread;
|
|
struct Clock;
|
|
|
|
class Timer : public LinkedListNode<Timer>
|
|
{
|
|
public:
|
|
u64 delta_ticks { 0 };
|
|
u64 interval_ticks { 0 };
|
|
Thread* thread;
|
|
int signo { SIGALRM };
|
|
bool restart { false };
|
|
|
|
void disarm();
|
|
void arm(Clock* clock, u64 ticks);
|
|
|
|
Clock* active_clock { nullptr };
|
|
Clock* designated_clock { nullptr };
|
|
};
|