Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions genc/cc/base/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ std::shared_ptr<ContextStack> GetContextStack() {
}

void ContextStack::SetDefaultContext(std::shared_ptr<Context> ctx) {
absl::MutexLock lock(&mutex_);
absl::MutexLock lock(mutex_);
default_context_ = ctx;
}

void ContextStack::AppendNestedContext(std::shared_ptr<Context> ctx) {
absl::MutexLock lock(&mutex_);
absl::MutexLock lock(mutex_);
nested_contexts_.push_back(ctx);
}

absl::Status ContextStack::RemoveNestedContext(std::shared_ptr<Context> ctx) {
absl::MutexLock lock(&mutex_);
absl::MutexLock lock(mutex_);
if (nested_contexts_.empty()) {
return absl::FailedPreconditionError("No nested context on the stack.");
}
Expand All @@ -61,7 +61,7 @@ absl::Status ContextStack::RemoveNestedContext(std::shared_ptr<Context> ctx) {
}

std::shared_ptr<Context> ContextStack::CurrentContext() const {
absl::ReaderMutexLock lock(&mutex_);
absl::ReaderMutexLock lock(mutex_);
if (!nested_contexts_.empty()) {
return nested_contexts_.back();
}
Expand Down
Loading