diff options
author | Lukas Larsson <lukas@erlang.org> | 2022-01-05 17:17:15 +0100 |
---|---|---|
committer | Lukas Larsson <lukas@erlang.org> | 2022-01-21 09:22:26 +0100 |
commit | d43ff28cf3b6cc1afa46027143cc6e33368dc008 (patch) | |
tree | 0c8f151d3ce26a6411aa2ae5af7ed28ff92e8a68 /lib/common_test/src | |
parent | 0d060f1ddc7b7090b48dff96ff68180290062085 (diff) | |
download | erlang-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/common_test/src')
-rw-r--r-- | lib/common_test/src/ct_hooks_lock.erl | 6 |
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. |