aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_time.h
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2015-03-26 22:46:29 +0100
committerRickard Green <[email protected]>2015-05-06 15:58:32 +0200
commitedce22eb43c40359ccbd0924412cf13692744779 (patch)
tree4ecb3fd82be20f5e1bfa49e777310ca04c2d8ab8 /erts/emulator/beam/erl_time.h
parentbf3b377220f2531b9b101f32222067beb3ea750b (diff)
downloadotp-edce22eb43c40359ccbd0924412cf13692744779.tar.gz
otp-edce22eb43c40359ccbd0924412cf13692744779.tar.bz2
otp-edce22eb43c40359ccbd0924412cf13692744779.zip
Misc time improvements
- Possibility to chose different clock sources - Improved mach clock usage - Improved linux clock_gettime() usage - ...
Diffstat (limited to 'erts/emulator/beam/erl_time.h')
-rw-r--r--erts/emulator/beam/erl_time.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_time.h b/erts/emulator/beam/erl_time.h
index cb7764addc..5af3c21d40 100644
--- a/erts/emulator/beam/erl_time.h
+++ b/erts/emulator/beam/erl_time.h
@@ -26,6 +26,12 @@
#define ERTS_TIME_ASSERT(B) ((void) 1)
#endif
+typedef enum {
+ ERTS_NO_TIME_WARP_MODE,
+ ERTS_SINGLE_TIME_WARP_MODE,
+ ERTS_MULTI_TIME_WARP_MODE
+} ErtsTimeWarpMode;
+
typedef struct ErtsTimerWheel_ ErtsTimerWheel;
typedef erts_atomic64_t * ErtsNextTimeoutRef;
extern ErtsTimerWheel *erts_default_timer_wheel;
@@ -38,7 +44,6 @@ extern SysTimeval erts_first_emu_time;
typedef struct erl_timer {
struct erl_timer* next; /* next entry tiw slot or chain */
struct erl_timer* prev; /* prev entry tiw slot or chain */
- Uint slot; /* slot in timer wheel */
erts_smp_atomic_t wheel;
ErtsMonotonicTime timeout_pos; /* Timeout in absolute clock ticks */
/* called when timeout */
@@ -46,6 +51,7 @@ typedef struct erl_timer {
/* called when cancel (may be NULL) */
void (*cancel)(void*);
void* arg; /* argument to timeout/cancel procs */
+ int slot; /* slot in timer wheel */
} ErlTimer;
typedef void (*ErlTimeoutProc)(void*);
@@ -77,6 +83,7 @@ void erts_cancel_smp_ptimer(ErtsSmpPTimer *ptimer);
void erts_monitor_time_offset(Eterm id, Eterm ref);
int erts_demonitor_time_offset(Eterm ref);
+int erts_init_time_sup(int, ErtsTimeWarpMode);
void erts_late_init_time_sup(void);
/* timer-wheel api */