diff options
author | Rickard Green <[email protected]> | 2015-12-29 15:26:00 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2015-12-29 15:26:00 +0100 |
commit | 172d3bf7b28b28f3ac6ecd2348f1d8cd8db7ff7a (patch) | |
tree | 35f02c78cc75d0954673e5464ca42f2bf5ca15e5 | |
parent | 6b60ed6d30dccaeab1207178d5e786aaa14b3201 (diff) | |
download | otp-172d3bf7b28b28f3ac6ecd2348f1d8cd8db7ff7a.tar.gz otp-172d3bf7b28b28f3ac6ecd2348f1d8cd8db7ff7a.tar.bz2 otp-172d3bf7b28b28f3ac6ecd2348f1d8cd8db7ff7a.zip |
Fix asynchronous BIF timer cancellation message reply
-rw-r--r-- | erts/emulator/beam/erl_hl_timer.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/erts/emulator/beam/erl_hl_timer.c b/erts/emulator/beam/erl_hl_timer.c index 6853278828..734057a12c 100644 --- a/erts/emulator/beam/erl_hl_timer.c +++ b/erts/emulator/beam/erl_hl_timer.c @@ -2018,7 +2018,7 @@ bif_timer_access_request(void *vreq) static int try_access_sched_remote_btm(ErtsSchedulerData *esdp, Process *c_p, Uint32 sid, - Eterm tref, Uint32 *trefn, + Uint32 *trefn, int async, int cancel, int info, Eterm *resp) { @@ -2078,13 +2078,13 @@ try_access_sched_remote_btm(ErtsSchedulerData *esdp, } else { ErtsMessage *mp; - Eterm tag, res, msg; + Eterm tag, res, msg, tref; Uint hsz; Eterm *hp; ErtsProcLocks proc_locks = ERTS_PROC_LOCK_MAIN; ErlOffHeap *ohp; - hsz = 4; + hsz = 4 + REF_THING_SIZE; if (time_left > (Sint64) MAX_SMALL) hsz += ERTS_SINT64_HEAP_SIZE(time_left); @@ -2095,6 +2095,13 @@ try_access_sched_remote_btm(ErtsSchedulerData *esdp, else tag = am_read_timer; + write_ref_thing(hp, + trefn[0], + trefn[1], + trefn[2]); + tref = make_internal_ref(hp); + hp += REF_THING_SIZE; + if (time_left < 0) res = am_false; else if (time_left <= (Sint64) MAX_SMALL) @@ -2145,8 +2152,8 @@ access_bif_timer(Process *c_p, Eterm tref, int cancel, int async, int info) info); ERTS_BIF_PREP_RET(ret, res); } - else if (try_access_sched_remote_btm(esdp, c_p, sid, - tref, trefn, + else if (try_access_sched_remote_btm(esdp, c_p, + sid, trefn, async, cancel, info, &res)) { ERTS_BIF_PREP_RET(ret, res); |