Skip to content

Commit

Permalink
Fix race between callback and destructor (#1745) (#4222)
Browse files Browse the repository at this point in the history
Co-authored-by: DimasKovas <34828390+DimasKovas@users.noreply.github.com>
  • Loading branch information
azevaykin and DimasKovas authored May 2, 2024
1 parent 43a34f7 commit eae74a3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ydb/core/wrappers/s3_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ class TS3ExternalStorage: public IExternalStorageOperator, TS3User {
Y_DEFER {
std::unique_lock guard(RunningQueriesMutex);
--RunningQueriesCount;
bool needNotify = (RunningQueriesCount == 0);
guard.unlock();
if (needNotify) {
if (RunningQueriesCount == 0) {
RunningQueriesNotifier.notify_all();
}
};
Expand Down

0 comments on commit eae74a3

Please sign in to comment.