]> git.ipfire.org Git - thirdparty/asterisk.git/commit
chan_console: Fix deadlock caused by unclean thread exit.
authorNaveen Albert <asterisk@phreaknet.org>
Sat, 9 Sep 2023 15:24:37 +0000 (11:24 -0400)
committerAsterisk Development Team <asteriskteam@digium.com>
Fri, 12 Jan 2024 18:29:18 +0000 (18:29 +0000)
commit3fef46e7767b37ee3be9e9027b014025c99fdbac
tree5cc607f451e8f5b081a837210904a38e5e0702cc
parentd5a285c8f2c7d070658ad2c945fcf773d28bf8ba
chan_console: Fix deadlock caused by unclean thread exit.

To terminate a console channel, stop_stream causes pthread_cancel
to make stream_monitor exit. However, commit 5b8fea93d106332bc0faa4b7fa8a6ea71e546cac
added locking to this function which results in deadlock due to
the stream_monitor thread being killed while it's holding the pvt lock.

To resolve this, a flag is now set and read to indicate abort, so
the use of pthread_cancel and pthread_kill can be avoided altogether.

Resolves: #308
(cherry picked from commit 71215561d8d41b9b7993e66e0ab672f38e75eb48)
channels/chan_console.c