Merge pull request #94832 from alvinhochun/workerthreadpool-uaf
Fix use-after-free in WorkerThreadPool
This commit is contained in:
commit
5793d79ec5
|
@ -83,6 +83,10 @@ void WorkerThreadPool::_process_task(Task *p_task) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef THREADS_ENABLED
|
||||||
|
bool low_priority = p_task->low_priority;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (p_task->group) {
|
if (p_task->group) {
|
||||||
// Handling a group
|
// Handling a group
|
||||||
bool do_post = false;
|
bool do_post = false;
|
||||||
|
@ -159,7 +163,7 @@ void WorkerThreadPool::_process_task(Task *p_task) {
|
||||||
#ifdef THREADS_ENABLED
|
#ifdef THREADS_ENABLED
|
||||||
{
|
{
|
||||||
curr_thread.current_task = prev_task;
|
curr_thread.current_task = prev_task;
|
||||||
if (p_task->low_priority) {
|
if (low_priority) {
|
||||||
low_priority_threads_used--;
|
low_priority_threads_used--;
|
||||||
|
|
||||||
if (_try_promote_low_priority_task()) {
|
if (_try_promote_low_priority_task()) {
|
||||||
|
|
Loading…
Reference in New Issue