]> git.ipfire.org Git - thirdparty/asterisk.git/commit
taskprocessor.c: Prevent crash on graceful shutdown
authorMike Bradeen <mbradeen@sangoma.com>
Thu, 3 Feb 2022 01:18:06 +0000 (18:18 -0700)
committerMichael Bradeen <mbradeen@sangoma.com>
Mon, 14 Feb 2022 22:18:40 +0000 (16:18 -0600)
commit9e71f7fe3762899a44f3b08cee8f828c1b14b62a
tree27b3d2150606ffa940f3e674bf80267aa0cacd1e
parentfcdeb3e5b7c09c28347b605330db244f850c5a9e
taskprocessor.c: Prevent crash on graceful shutdown

When tps_shutdown is called as part of the cleanup process there is a
chance that one of the taskprocessors that references the
tps_singletons object is still running.  The change is to allow for
tps_shutdown to check tps_singleton's container count and give the
running taskprocessors a chance to finish.  If after
AST_TASKPROCESSOR_SHUTDOWN_MAX_WAIT (10) seconds there are still
container references we shutdown anyway as this is most likely a bug
due to a taskprocessor not being unreferenced.

ASTERISK-29365

Change-Id: Ia932fc003d316389b9c4fd15ad6594458c9727f1
main/taskprocessor.c