lwm_win32_cs.hpp
Go to the documentation of this file.
1 #ifndef BOOST_SMART_PTR_DETAIL_LWM_WIN32_CS_HPP_INCLUDED
2 #define BOOST_SMART_PTR_DETAIL_LWM_WIN32_CS_HPP_INCLUDED
3 
4 // MS compatible compilers support #pragma once
5 
6 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
7 # pragma once
8 #endif
9 
10 //
11 // boost/detail/lwm_win32_cs.hpp
12 //
13 // Copyright (c) 2002, 2003 Peter Dimov
14 // Copyright (c) Microsoft Corporation 2014
15 //
16 // Distributed under the Boost Software License, Version 1.0. (See
17 // accompanying file LICENSE_1_0.txt or copy at
18 // http://www.boost.org/LICENSE_1_0.txt)
19 //
20 
21 #include <boost/predef.h>
22 
23 #ifdef BOOST_USE_WINDOWS_H
24 # include <windows.h>
25 #endif
26 
27 namespace boost
28 {
29 
30 namespace detail
31 {
32 
33 #ifndef BOOST_USE_WINDOWS_H
34 
36 {
37  struct critical_section_debug * DebugInfo;
38  long LockCount;
40  void * OwningThread;
41  void * LockSemaphore;
42 #if defined(_WIN64)
43  unsigned __int64 SpinCount;
44 #else
45  unsigned long SpinCount;
46 #endif
47 };
48 
49 #if BOOST_PLAT_WINDOWS_RUNTIME
50 extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSectionEx(critical_section *, unsigned long, unsigned long);
51 #else
52 extern "C" __declspec(dllimport) void __stdcall InitializeCriticalSection(critical_section *);
53 #endif
54 extern "C" __declspec(dllimport) void __stdcall EnterCriticalSection(critical_section *);
55 extern "C" __declspec(dllimport) void __stdcall LeaveCriticalSection(critical_section *);
56 extern "C" __declspec(dllimport) void __stdcall DeleteCriticalSection(critical_section *);
57 
58 #else
59 
60 typedef ::CRITICAL_SECTION critical_section;
61 
62 #endif // #ifndef BOOST_USE_WINDOWS_H
63 
65 {
66 private:
67 
69 
72 
73 public:
74 
76  {
77 #if BOOST_PLAT_WINDOWS_RUNTIME
78  InitializeCriticalSectionEx(&cs_, 4000, 0);
79 #else
80  InitializeCriticalSection(&cs_);
81 #endif
82  }
83 
85  {
86  DeleteCriticalSection(&cs_);
87  }
88 
89  class scoped_lock;
90  friend class scoped_lock;
91 
92  class scoped_lock
93  {
94  private:
95 
97 
98  scoped_lock(scoped_lock const &);
100 
101  public:
102 
103  explicit scoped_lock(lightweight_mutex & m): m_(m)
104  {
105  EnterCriticalSection(&m_.cs_);
106  }
107 
109  {
110  LeaveCriticalSection(&m_.cs_);
111  }
112  };
113 };
114 
115 } // namespace detail
116 
117 } // namespace boost
118 
119 #endif // #ifndef BOOST_SMART_PTR_DETAIL_LWM_WIN32_CS_HPP_INCLUDED
boost::detail::critical_section::LockSemaphore
void * LockSemaphore
Definition: lwm_win32_cs.hpp:41
boost::detail::lightweight_mutex::~lightweight_mutex
~lightweight_mutex()
Definition: lwm_win32_cs.hpp:84
boost::detail::lightweight_mutex::scoped_lock::operator=
scoped_lock & operator=(scoped_lock const &)
boost::detail::lightweight_mutex::scoped_lock::m_
pthread_mutex_t & m_
Definition: lwm_pthreads.hpp:64
boost::detail::critical_section::OwningThread
void * OwningThread
Definition: lwm_win32_cs.hpp:40
boost::detail::lightweight_mutex::scoped_lock::scoped_lock
scoped_lock(lightweight_mutex &m)
Definition: lwm_win32_cs.hpp:103
boost::detail::lightweight_mutex::cs_
critical_section cs_
Definition: lwm_win32_cs.hpp:68
boost::detail::critical_section::SpinCount
unsigned long SpinCount
Definition: lwm_win32_cs.hpp:45
predef.h
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
boost::detail::critical_section::LockCount
long LockCount
Definition: lwm_win32_cs.hpp:38
boost::detail::lightweight_mutex::operator=
lightweight_mutex & operator=(lightweight_mutex const &)
boost::detail::lightweight_mutex::scoped_lock::~scoped_lock
~scoped_lock()
Definition: lwm_win32_cs.hpp:108
boost::detail::critical_section
Definition: lwm_win32_cs.hpp:35
boost::detail::lightweight_mutex::scoped_lock::m_
lightweight_mutex & m_
Definition: lwm_win32_cs.hpp:96
boost::detail::lightweight_mutex::scoped_lock
lightweight_mutex scoped_lock
Definition: lwm_nop.hpp:30
boost::detail::lightweight_mutex::scoped_lock::scoped_lock
scoped_lock(scoped_lock const &)
boost::detail::critical_section::DebugInfo
struct critical_section_debug * DebugInfo
Definition: lwm_win32_cs.hpp:37
boost::detail::__declspec
__declspec(dllimport) void __stdcall InitializeCriticalSection(critical_section *)
windows.h
boost::detail::critical_section::RecursionCount
long RecursionCount
Definition: lwm_win32_cs.hpp:39
boost::detail::lightweight_mutex
Definition: lwm_nop.hpp:26
boost::detail::lightweight_mutex::scoped_lock
Definition: lwm_pthreads.hpp:60
boost::detail::lightweight_mutex::lightweight_mutex
lightweight_mutex()
Definition: lwm_pthreads.hpp:40


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:43:36