aws / aws-sdk-cpp

AWS SDK for C++
Apache License 2.0
1.98k stars 1.06k forks source link

Issue 2744: fix liveness / performance bug in PooledThreadExecutor #2745

Closed hunjmes closed 4 months ago

hunjmes commented 1 year ago

Issue #, if available: 2744

Description of changes: Ensures that ThreadTask holds the PooledThreadExecutor's mutex between when it sees that the m_executor does not have any tasks, and when it waits on the condition variable.

Since AWS Semaphore does not take a mutex as parameter, replaces use of Semaphore with std::condition_variable here.

Check all that applies:

Check which platforms you have built SDK on to verify the correctness of this PR.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

jmklix commented 4 months ago

rebase: https://github.com/aws/aws-sdk-cpp/pull/3040