blob: fc0c9b562e9f175cf25392a4c76c9e86e01d1681 [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// 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/third_party/quiche/src/quic/platform/api/quic_mutex.h"
6
7namespace quic {
8
9void QuicMutex::WriterLock() {
10 impl_.WriterLock();
11}
12
13void QuicMutex::WriterUnlock() {
14 impl_.WriterUnlock();
15}
16
17void QuicMutex::ReaderLock() {
18 impl_.ReaderLock();
19}
20
21void QuicMutex::ReaderUnlock() {
22 impl_.ReaderUnlock();
23}
24
25void QuicMutex::AssertReaderHeld() const {
26 impl_.AssertReaderHeld();
27}
28
29QuicReaderMutexLock::QuicReaderMutexLock(QuicMutex* lock) : lock_(lock) {
30 lock->ReaderLock();
31}
32
33QuicReaderMutexLock::~QuicReaderMutexLock() {
34 lock_->ReaderUnlock();
35}
36
37QuicWriterMutexLock::QuicWriterMutexLock(QuicMutex* lock) : lock_(lock) {
38 lock->WriterLock();
39}
40
41QuicWriterMutexLock::~QuicWriterMutexLock() {
42 lock_->WriterUnlock();
43}
44
45} // namespace quic