]> 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:20:17 +0000 (16:20 -0600)
commit3b1debb28bcfd25541e38273c34deddc7fc6f0d0
treeea21ee640cb400ff06cbcf304863d3d54834ec7f
parentb41440a179789c66fffcbef472b5ba2c8ed1e789
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