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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/quic/platform/api/quic_mutex.h"
6
7 namespace net {
8
9 void QuicMutex::WriterLock() {
10 impl_.WriterLock();
11 }
12
13 void QuicMutex::WriterUnlock() {
14 impl_.WriterUnlock();
15 }
16
17 void QuicMutex::ReaderLock() {
18 impl_.ReaderLock();
19 }
20
21 void QuicMutex::ReaderUnlock() {
22 impl_.ReaderUnlock();
23 }
24
25 void QuicMutex::AssertReaderHeld() const {
26 impl_.AssertReaderHeld();
27 }
28
29 QuicReaderMutexLock::QuicReaderMutexLock(QuicMutex* lock) : lock_(lock) {
30 lock->ReaderLock();
31 }
32
33 QuicReaderMutexLock::~QuicReaderMutexLock() {
34 lock_->ReaderUnlock();
35 }
36
37 QuicWriterMutexLock::QuicWriterMutexLock(QuicMutex* lock) : lock_(lock) {
38 lock->WriterLock();
39 }
40
41 QuicWriterMutexLock::~QuicWriterMutexLock() {
42 lock_->WriterUnlock();
43 }
44
45 } // namespace net
OLDNEW
« 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