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

Unified Diff: net/quic/platform/api/quic_mutex.cc

Issue 2561913003: Create a QUIC wrapper around a mutex and a mutex lock. (Closed)
Patch Set: fix Created 4 years 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
« no previous file with comments | « net/quic/platform/api/quic_mutex.h ('k') | net/quic/platform/impl/quic_mutex_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/platform/api/quic_mutex.cc
diff --git a/net/quic/platform/api/quic_mutex.cc b/net/quic/platform/api/quic_mutex.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f0c8f0997ae4e99a7fc034adec894fb2ac489247
--- /dev/null
+++ b/net/quic/platform/api/quic_mutex.cc
@@ -0,0 +1,45 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/quic/platform/api/quic_mutex.h"
+
+namespace net {
+
+void QuicMutex::WriterLock() {
+ impl_.WriterLock();
+}
+
+void QuicMutex::WriterUnlock() {
+ impl_.WriterUnlock();
+}
+
+void QuicMutex::ReaderLock() {
+ impl_.ReaderLock();
+}
+
+void QuicMutex::ReaderUnlock() {
+ impl_.ReaderUnlock();
+}
+
+void QuicMutex::AssertReaderHeld() const {
+ impl_.AssertReaderHeld();
+}
+
+QuicReaderMutexLock::QuicReaderMutexLock(QuicMutex* lock) : lock_(lock) {
+ lock->ReaderLock();
+}
+
+QuicReaderMutexLock::~QuicReaderMutexLock() {
+ lock_->ReaderUnlock();
+}
+
+QuicWriterMutexLock::QuicWriterMutexLock(QuicMutex* lock) : lock_(lock) {
+ lock->WriterLock();
+}
+
+QuicWriterMutexLock::~QuicWriterMutexLock() {
+ lock_->WriterUnlock();
+}
+
+} // namespace net
« no previous file with comments | « net/quic/platform/api/quic_mutex.h ('k') | net/quic/platform/impl/quic_mutex_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698