aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2015-12-30 11:31:05 +0100
committerRickard Green <[email protected]>2015-12-30 11:31:05 +0100
commit5a22322e8448e63aa45432da90d3f01ab4cc432a (patch)
tree0a88007f55117939146a63aa1a556b0cdd473f36
parentf4bb08fa2a409369fcf50a381a52531d8ed20114 (diff)
parent172d3bf7b28b28f3ac6ecd2348f1d8cd8db7ff7a (diff)
downloadotp-5a22322e8448e63aa45432da90d3f01ab4cc432a.tar.gz
otp-5a22322e8448e63aa45432da90d3f01ab4cc432a.tar.bz2
otp-5a22322e8448e63aa45432da90d3f01ab4cc432a.zip
Merge branch 'rickard/ohmq-fixup/OTP-13047'
* rickard/ohmq-fixup/OTP-13047: Fix asynchronous BIF timer cancellation message reply
-rw-r--r--erts/emulator/beam/erl_hl_timer.c17
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);