aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-05-29 14:41:14 +0200
committerBjörn Gustavsson <[email protected]>2017-05-29 14:50:39 +0200
commit23f132d9ab776ab94c29f1faed76c9fde8f4a73f (patch)
tree321f24cb0a753e15927460f784ea4b28042a02db /erts/emulator
parent6ebe1a85f0ae97b383a9c1fa838b4e9f9a808e21 (diff)
downloadotp-23f132d9ab776ab94c29f1faed76c9fde8f4a73f.tar.gz
otp-23f132d9ab776ab94c29f1faed76c9fde8f4a73f.tar.bz2
otp-23f132d9ab776ab94c29f1faed76c9fde8f4a73f.zip
Make sure that asynchronous replies are not lost
If an synchronous GC was requested by calling: erlang:garbage_collect(Pid, [{async,Ref}]) the reply message could in certain circumstances be lost. The problem is in cleanup_sys_tasks() in erl_process.c. If there were at least one dirty task, only the first dirty task would be cleaned up. All other systems tasks would not be cleaned up (that is, no replies would be sent to other processes waiting for the tasks to finish).
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_process.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index 7952e3031d..0575729bbd 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -11331,7 +11331,9 @@ cleanup_sys_tasks(Process *c_p, erts_aint32_t in_state, int in_reds)
erts_aint32_t state = in_state;
int max_reds = in_reds;
int reds = 0;
- int qmask = 0;
+ int qmask = 1; /* Set to 1 to force looping as long as there
+ * are dirty tasks.
+ */
ERTS_SMP_LC_ASSERT(erts_proc_lc_my_proc_locks(c_p) == ERTS_PROC_LOCK_MAIN);