xref: /aosp_15_r20/external/cronet/base/synchronization/lock_impl_win.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2011 The Chromium Authors
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/lock_impl.h"
6 
7 #include <windows.h>
8 
9 namespace base {
10 namespace internal {
11 
LockImpl()12 LockImpl::LockImpl() : native_handle_(SRWLOCK_INIT) {}
13 
14 LockImpl::~LockImpl() = default;
15 
LockInternal()16 void LockImpl::LockInternal() {
17   ::AcquireSRWLockExclusive(reinterpret_cast<PSRWLOCK>(&native_handle_));
18 }
19 
20 }  // namespace internal
21 }  // namespace base
22