mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-20 18:53:47 +00:00
Correct WorkDelegate::DoWork race condition with an atomic_bool.
Bug:crashpad:380 Change-Id: Iae523f22366ca65816c42b499bd482056efb5bca Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3244729 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Justin Cohen <justincohen@chromium.org>
This commit is contained in:
parent
0118cc44aa
commit
aaed581a53
@ -15,6 +15,7 @@
|
|||||||
#ifndef CRASHPAD_UTIL_THREAD_WORKER_THREAD_H_
|
#ifndef CRASHPAD_UTIL_THREAD_WORKER_THREAD_H_
|
||||||
#define CRASHPAD_UTIL_THREAD_WORKER_THREAD_H_
|
#define CRASHPAD_UTIL_THREAD_WORKER_THREAD_H_
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "util/synchronization/semaphore.h"
|
#include "util/synchronization/semaphore.h"
|
||||||
@ -95,7 +96,7 @@ class WorkerThread {
|
|||||||
Delegate* delegate_; // weak
|
Delegate* delegate_; // weak
|
||||||
std::unique_ptr<internal::WorkerThreadImpl> impl_;
|
std::unique_ptr<internal::WorkerThreadImpl> impl_;
|
||||||
bool running_;
|
bool running_;
|
||||||
bool do_work_now_;
|
std::atomic_bool do_work_now_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace crashpad
|
} // namespace crashpad
|
||||||
|
Loading…
x
Reference in New Issue
Block a user