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

Side by Side Diff: third_party/protobuf/src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component 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
OLDNEW
1 // Protocol Buffers - Google's data interchange format 1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2012 Google Inc. All rights reserved. 2 // Copyright 2012 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/ 3 // https://developers.google.com/protocol-buffers/
4 // 4 //
5 // Redistribution and use in source and binary forms, with or without 5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are 6 // modification, are permitted provided that the following conditions are
7 // met: 7 // met:
8 // 8 //
9 // * Redistributions of source code must retain the above copyright 9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer. 10 // notice, this list of conditions and the following disclaimer.
(...skipping 26 matching lines...) Expand all
37 #include <google/protobuf/stubs/atomicops.h> 37 #include <google/protobuf/stubs/atomicops.h>
38 38
39 #ifdef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_ 39 #ifdef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_
40 40
41 #include <windows.h> 41 #include <windows.h>
42 42
43 namespace google { 43 namespace google {
44 namespace protobuf { 44 namespace protobuf {
45 namespace internal { 45 namespace internal {
46 46
47 inline void MemoryBarrier() { 47 inline void MemoryBarrierInternal() {
48 // We use MemoryBarrier from WinNT.h 48 // On ARM this is a define while on x86/x64 this is
49 ::MemoryBarrier(); 49 // a function declared in WinNT.h
50 MemoryBarrier();
50 } 51 }
51 52
52 Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, 53 Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
53 Atomic32 old_value, 54 Atomic32 old_value,
54 Atomic32 new_value) { 55 Atomic32 new_value) {
55 LONG result = InterlockedCompareExchange( 56 LONG result = InterlockedCompareExchange(
56 reinterpret_cast<volatile LONG*>(ptr), 57 reinterpret_cast<volatile LONG*>(ptr),
57 static_cast<LONG>(new_value), 58 static_cast<LONG>(new_value),
58 static_cast<LONG>(old_value)); 59 static_cast<LONG>(old_value));
59 return static_cast<Atomic32>(result); 60 return static_cast<Atomic32>(result);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 104 }
104 105
105 #endif // defined(_WIN64) 106 #endif // defined(_WIN64)
106 107
107 } // namespace internal 108 } // namespace internal
108 } // namespace protobuf 109 } // namespace protobuf
109 } // namespace google 110 } // namespace google
110 111
111 #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_ 112 #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_MSVC_H_
112 #endif // GOOGLE_PROTOBUF_NO_THREAD_SAFETY 113 #endif // GOOGLE_PROTOBUF_NO_THREAD_SAFETY
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698