aboutsummaryrefslogtreecommitdiff
path: root/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h')
-rw-r--r--third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h35
1 files changed, 4 insertions, 31 deletions
diff --git a/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h b/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h
index 9baccc0659..961cc981b8 100644
--- a/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h
+++ b/third_party/abseil-cpp/absl/base/internal/low_level_scheduling.h
@@ -18,7 +18,6 @@
#ifndef ABSL_BASE_INTERNAL_LOW_LEVEL_SCHEDULING_H_
#define ABSL_BASE_INTERNAL_LOW_LEVEL_SCHEDULING_H_
-#include "absl/base/internal/raw_logging.h"
#include "absl/base/internal/scheduling_mode.h"
#include "absl/base/macros.h"
@@ -30,13 +29,6 @@ extern "C" void __google_enable_rescheduling(bool disable_result);
namespace absl {
ABSL_NAMESPACE_BEGIN
-class CondVar;
-class Mutex;
-
-namespace synchronization_internal {
-int MutexDelay(int32_t c, int mode);
-} // namespace synchronization_internal
-
namespace base_internal {
class SchedulingHelper; // To allow use of SchedulingGuard.
@@ -61,8 +53,6 @@ class SchedulingGuard {
public:
// Returns true iff the calling thread may be cooperatively rescheduled.
static bool ReschedulingIsAllowed();
- SchedulingGuard(const SchedulingGuard&) = delete;
- SchedulingGuard& operator=(const SchedulingGuard&) = delete;
private:
// Disable cooperative rescheduling of the calling thread. It may still
@@ -86,23 +76,12 @@ class SchedulingGuard {
bool disabled;
};
- // A scoped helper to enable rescheduling temporarily.
- // REQUIRES: destructor must run in same thread as constructor.
- class ScopedEnable {
- public:
- ScopedEnable();
- ~ScopedEnable();
-
- private:
- int scheduling_disabled_depth_;
- };
-
- // Access to SchedulingGuard is explicitly permitted.
- friend class absl::CondVar;
- friend class absl::Mutex;
+ // Access to SchedulingGuard is explicitly white-listed.
friend class SchedulingHelper;
friend class SpinLock;
- friend int absl::synchronization_internal::MutexDelay(int32_t c, int mode);
+
+ SchedulingGuard(const SchedulingGuard&) = delete;
+ SchedulingGuard& operator=(const SchedulingGuard&) = delete;
};
//------------------------------------------------------------------------------
@@ -121,12 +100,6 @@ inline void SchedulingGuard::EnableRescheduling(bool /* disable_result */) {
return;
}
-inline SchedulingGuard::ScopedEnable::ScopedEnable()
- : scheduling_disabled_depth_(0) {}
-inline SchedulingGuard::ScopedEnable::~ScopedEnable() {
- ABSL_RAW_CHECK(scheduling_disabled_depth_ == 0, "disable unused warning");
-}
-
} // namespace base_internal
ABSL_NAMESPACE_END
} // namespace absl