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

Side by Side Diff: base/synchronization/rw_lock_win.cc

Issue 1988563002: Create a reader-writer lock implementaiton in base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simple-stupid implementaiton for NaCl Created 4 years, 7 months 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
OLDNEW
(Empty)
1 // Copyright 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 "base/synchronization/rw_lock.h"
6
7 namespace base {
8
9 RWLock::RWLock() : native_handle_(SRWLOCK_INIT) {}
10
11 RWLock::~RWLock() = default;
12
13 void RWLock::ReadAcquire() {
14 ::AcquireSRWLockShared(&native_handle_);
15 }
16
17 void RWLock::ReadRelease() {
18 ::ReleaseSRWLockShared(&native_handle_);
19 }
20
21 void RWLock::WriteAcquire() {
22 ::AcquireSRWLockExclusive(&native_handle_);
23 }
24
25 void RWLock::WriteRelease() {
26 ::ReleaseSRWLockExclusive(&native_handle_);
27 }
28
29 } // namespace base
OLDNEW
« base/synchronization/rw_lock_unittest.cc ('K') | « base/synchronization/rw_lock_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698