Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1357)

Unified Diff: third_party/crashpad/crashpad/util/thread/worker_thread.h

Issue 2825103002: Update Crashpad to b8aaa22905308cc400f880006a84dddac834bd6b (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/crashpad/crashpad/util/thread/worker_thread.h
diff --git a/third_party/crashpad/crashpad/util/thread/worker_thread.h b/third_party/crashpad/crashpad/util/thread/worker_thread.h
index 321d9184353433ef749e13d2f8533afd070d48bb..97fb6ecde01f6c893f80327a2b9636b0c93e5780 100644
--- a/third_party/crashpad/crashpad/util/thread/worker_thread.h
+++ b/third_party/crashpad/crashpad/util/thread/worker_thread.h
@@ -18,6 +18,7 @@
#include <memory>
#include "base/macros.h"
+#include "util/synchronization/semaphore.h"
namespace crashpad {
@@ -40,11 +41,16 @@ class WorkerThread {
virtual ~Delegate() {}
};
+ //! \brief A delay or interval argument that causes an indefinite wait.
+ static constexpr double kIndefiniteWait = Semaphore::kIndefiniteWait;
+
//! \brief Creates a new WorkerThread that is not yet running.
//!
//! \param[in] work_interval The time interval in seconds at which the \a
//! delegate runs. The interval counts from the completion of
- //! Delegate::DoWork() to the next invocation.
+ //! Delegate::DoWork() to the next invocation. This can be
+ //! #kIndefiniteWait if work should only be done when DoWorkNow() is
+ //! called.
//! \param[in] delegate The work delegate to invoke every interval.
WorkerThread(double work_interval, Delegate* delegate);
~WorkerThread();
@@ -55,7 +61,8 @@ class WorkerThread {
//!
//! \param[in] initial_work_delay The amount of time in seconds to wait
//! before invoking the \a delegate for the first time. Pass `0` for
- //! no delay.
+ //! no delay. This can be #kIndefiniteWait if work should not be done
+ //! until DoWorkNow() is called.
void Start(double initial_work_delay);
//! \brief Stops the worker thread from running.

Powered by Google App Engine
This is Rietveld 408576698