aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_time.h
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-02-03 15:50:51 +0100
committerRickard Green <[email protected]>2017-04-18 12:40:02 +0200
commit79ac974710ecab6dfe37b23b4fd3b52e760b3504 (patch)
treea2d98d1c42ba4a6c93b57c8e96de6f30ad2ceb45 /erts/emulator/beam/erl_time.h
parenta09f867979d8039434271a2177c90aabced3a255 (diff)
downloadotp-79ac974710ecab6dfe37b23b4fd3b52e760b3504.tar.gz
otp-79ac974710ecab6dfe37b23b4fd3b52e760b3504.tar.bz2
otp-79ac974710ecab6dfe37b23b4fd3b52e760b3504.zip
Rearrange timer struct fields in order to simplify
Diffstat (limited to 'erts/emulator/beam/erl_time.h')
-rw-r--r--erts/emulator/beam/erl_time.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/erts/emulator/beam/erl_time.h b/erts/emulator/beam/erl_time.h
index a1c4220633..2fb4b754d7 100644
--- a/erts/emulator/beam/erl_time.h
+++ b/erts/emulator/beam/erl_time.h
@@ -419,17 +419,12 @@ void erts_sched_init_time_sup(ErtsSchedulerData *esdp);
** Timer entry:
*/
typedef struct erl_timer {
+ ErtsMonotonicTime timeout_pos; /* Timeout in absolute clock ticks */
struct erl_timer* next; /* next entry tiw slot or chain */
struct erl_timer* prev; /* prev entry tiw slot or chain */
- union {
- struct {
- void (*timeout)(void*); /* called when timeout */
- void (*cancel)(void*); /* called when cancel (may be NULL) */
- void* arg; /* argument to timeout/cancel procs */
- } func;
- ErtsThrPrgrLaterOp cleanup;
- } u;
- ErtsMonotonicTime timeout_pos; /* Timeout in absolute clock ticks */
+ void (*timeout)(void*); /* called when timeout */
+ void (*cancel)(void*); /* called when cancel (may be NULL) */
+ void* arg; /* argument to timeout/cancel procs */
int slot;
} ErtsTWheelTimer;
@@ -447,6 +442,7 @@ ErtsMonotonicTime erts_check_next_timeout_time(ErtsSchedulerData *);
ERTS_GLB_INLINE void erts_twheel_init_timer(ErtsTWheelTimer *p);
ERTS_GLB_INLINE ErtsMonotonicTime erts_next_timeout_time(ErtsNextTimeoutRef);
+ERTS_GLB_INLINE ErtsMonotonicTime erts_tweel_read_timeout(ErtsTWheelTimer *twt);
#if ERTS_GLB_INLINE_INCL_FUNC_DEF
@@ -460,6 +456,12 @@ ERTS_GLB_INLINE ErtsMonotonicTime erts_next_timeout_time(ErtsNextTimeoutRef nxt_
return *((ErtsMonotonicTime *) nxt_tmo_ref);
}
+ERTS_GLB_INLINE ErtsMonotonicTime
+erts_tweel_read_timeout(ErtsTWheelTimer *twt)
+{
+ return twt->timeout_pos;
+}
+
#endif /* ERTS_GLB_INLINE_INCL_FUNC_DEF */
void