Skip to content

Commit

Permalink
remove lock from implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
malloxpb committed Jul 20, 2018
1 parent f3249ce commit a61a1f5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 236 deletions.
6 changes: 3 additions & 3 deletions at_exit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void AtExitManager::RegisterTask(base::Closure task) {
return;
}

AutoLock lock(g_top_manager->lock_);
// AutoLock lock(g_top_manager->lock_);
// DCHECK(!g_top_manager->processing_callbacks_);
g_top_manager->stack_.push(std::move(task));
}
Expand All @@ -76,7 +76,7 @@ void AtExitManager::ProcessCallbacksNow() {
// handle it gracefully in release builds so we don't deadlock.
base::stack<base::Closure> tasks;
{
AutoLock lock(g_top_manager->lock_);
// AutoLock lock(g_top_manager->lock_);
tasks.swap(g_top_manager->stack_);
g_top_manager->processing_callbacks_ = true;
}
Expand All @@ -96,7 +96,7 @@ void AtExitManager::ProcessCallbacksNow() {
}

void AtExitManager::DisableAllAtExitManagers() {
AutoLock lock(g_top_manager->lock_);
// AutoLock lock(g_top_manager->lock_);
g_disable_managers = true;
}

Expand Down
4 changes: 2 additions & 2 deletions at_exit.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "base/callback.h"
#include "base/containers/stack.h"
#include "base/macros.h"
#include "base/synchronization/lock.h"
// #include "base/synchronization/lock.h"

namespace base {

Expand Down Expand Up @@ -60,7 +60,7 @@ class BASE_EXPORT AtExitManager {
explicit AtExitManager(bool shadow);

private:
base::Lock lock_;
// base::Lock lock_;
base::stack<base::Closure> stack_;
bool processing_callbacks_;
AtExitManager* next_manager_; // Stack of managers to allow shadowing.
Expand Down
4 changes: 2 additions & 2 deletions sequence_checker_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "base/base_export.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/synchronization/lock.h"
// #include "base/synchronization/lock.h"

namespace base {

Expand All @@ -37,7 +37,7 @@ class BASE_EXPORT SequenceCheckerImpl {
class Core;

// Guards all variables below.
mutable Lock lock_;
// mutable Lock lock_;
mutable std::unique_ptr<Core> core_;

DISALLOW_COPY_AND_ASSIGN(SequenceCheckerImpl);
Expand Down
151 changes: 0 additions & 151 deletions synchronization/lock.h

This file was deleted.

78 changes: 0 additions & 78 deletions synchronization/lock_impl.h

This file was deleted.

0 comments on commit a61a1f5

Please sign in to comment.