summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLukas Larsson <lukas@erlang.org>2022-01-05 17:17:15 +0100
committerLukas Larsson <lukas@erlang.org>2022-01-21 09:22:26 +0100
commitd43ff28cf3b6cc1afa46027143cc6e33368dc008 (patch)
tree0c8f151d3ce26a6411aa2ae5af7ed28ff92e8a68 /lib
parent0d060f1ddc7b7090b48dff96ff68180290062085 (diff)
downloaderlang-d43ff28cf3b6cc1afa46027143cc6e33368dc008.tar.gz
ct: Fix crash in ct_hooks_lock
If a process with a hook lock crashes when it is the only process with a lock we should return to an unlocked state and continue as normal.
Diffstat (limited to 'lib')
-rw-r--r--lib/common_test/src/ct_hooks_lock.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/common_test/src/ct_hooks_lock.erl b/lib/common_test/src/ct_hooks_lock.erl
index be50a33e01..16c95b9b46 100644
--- a/lib/common_test/src/ct_hooks_lock.erl
+++ b/lib/common_test/src/ct_hooks_lock.erl
@@ -109,7 +109,11 @@ handle_info({'DOWN',Ref,process,Pid,_},
gen_server:reply(NextFrom, locked),
NextRef = monitor(process, NextPid),
{noreply,State#state{ locked = {true, NextPid, NextRef},
- requests = Rest } }.
+ requests = Rest } };
+handle_info({'DOWN',Ref,process,Pid,_},
+ #state{ locked = {true, Pid, Ref},
+ requests = [] } = State) ->
+ {noreply, State#state{ locked = false } }.
terminate(_Reason, _State) ->
ok.