]> 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)
committerNaveen Albert <asterisk@phreaknet.org>
Wed, 20 Sep 2023 19:15:45 +0000 (19:15 +0000)
commit3b027d1e476a444ec28883417a718ac123362dc1
treec7429a87a223df874e9bf76cfe5d145dd62a209f
parent0e0f99db1d62b7642a51d2552256eece5d435bc8
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
channels/chan_console.c