summaryrefslogtreecommitdiff
path: root/boost/interprocess
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:18:43 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:18:43 +0900
commit5ce2ccf2f23c6d3de4c79f216f57ca6f2a18ed16 (patch)
treebbee48efb9867d19ac3fdd84ba714c7af326cd53 /boost/interprocess
parentb8cf34c691623e4ec329053cbbf68522a855882d (diff)
downloadboost-5ce2ccf2f23c6d3de4c79f216f57ca6f2a18ed16.tar.gz
boost-5ce2ccf2f23c6d3de4c79f216f57ca6f2a18ed16.tar.bz2
boost-5ce2ccf2f23c6d3de4c79f216f57ca6f2a18ed16.zip
Imported Upstream version 1.68.0upstream/1.68.0
Diffstat (limited to 'boost/interprocess')
-rw-r--r--boost/interprocess/allocators/detail/adaptive_node_pool.hpp7
-rw-r--r--boost/interprocess/detail/win32_api.hpp10
-rw-r--r--boost/interprocess/detail/workaround.hpp15
-rw-r--r--boost/interprocess/errors.hpp17
4 files changed, 18 insertions, 31 deletions
diff --git a/boost/interprocess/allocators/detail/adaptive_node_pool.hpp b/boost/interprocess/allocators/detail/adaptive_node_pool.hpp
index d2b0b366fc..e9a8e2655c 100644
--- a/boost/interprocess/allocators/detail/adaptive_node_pool.hpp
+++ b/boost/interprocess/allocators/detail/adaptive_node_pool.hpp
@@ -48,13 +48,13 @@ template< class SegmentManager
, unsigned char OverheadPercent
>
class private_adaptive_node_pool
- : public boost::container::dtl::private_adaptive_node_pool_impl
+ : public boost::container::dtl::private_adaptive_node_pool_impl_rt
< typename SegmentManager::segment_manager_base_type
, ::boost::container::adaptive_pool_flag::size_ordered |
::boost::container::adaptive_pool_flag::address_ordered
>
{
- typedef boost::container::dtl::private_adaptive_node_pool_impl
+ typedef boost::container::dtl::private_adaptive_node_pool_impl_rt
< typename SegmentManager::segment_manager_base_type
, ::boost::container::adaptive_pool_flag::size_ordered |
::boost::container::adaptive_pool_flag::address_ordered
@@ -70,9 +70,6 @@ class private_adaptive_node_pool
static const size_type nodes_per_block = NodesPerBlock;
- //Deprecated, use node_per_block
- static const size_type nodes_per_chunk = NodesPerBlock;
-
//!Constructor from a segment manager. Never throws
private_adaptive_node_pool(segment_manager *segment_mngr)
: base_t(segment_mngr, NodeSize, NodesPerBlock, MaxFreeBlocks, OverheadPercent)
diff --git a/boost/interprocess/detail/win32_api.hpp b/boost/interprocess/detail/win32_api.hpp
index d12097f512..c948a556bb 100644
--- a/boost/interprocess/detail/win32_api.hpp
+++ b/boost/interprocess/detail/win32_api.hpp
@@ -1535,7 +1535,6 @@ struct function_address_holder
, NtOpenFile
, NtClose
, NtQueryTimerResolution
- , NtSetTimerResolution
, QueryPerformanceCounter
, QueryPerformanceFrequency
, NumFunction
@@ -1618,7 +1617,6 @@ const char *function_address_holder<Dummy>::FunctionNames[function_address_holde
"NtOpenFile",
"NtClose",
"NtQueryTimerResolution",
- "NtSetTimerResolution",
"QueryPerformanceCounter",
"QueryPerformanceFrequency"
};
@@ -1634,7 +1632,6 @@ unsigned int function_address_holder<Dummy>::FunctionModules[function_address_ho
NtDll_dll,
NtDll_dll,
NtDll_dll,
- NtDll_dll,
Kernel32_dll,
Kernel32_dll
};
@@ -2441,13 +2438,6 @@ inline bool query_timer_resolution(unsigned long *lowres, unsigned long *highres
return !pNtQueryTimerResolution(lowres, highres, curres);
}
-inline bool set_timer_resolution(unsigned long RequestedResolution, int Set, unsigned long* ActualResolution)
-{
- winapi::NtSetTimerResolution_t pNtSetTimerResolution =
- (winapi::NtSetTimerResolution_t)dll_func::get(winapi::dll_func::NtSetTimerResolution);
- return !pNtSetTimerResolution(RequestedResolution, Set, ActualResolution);
-}
-
inline bool query_performance_counter(__int64 *lpPerformanceCount)
{
QueryPerformanceCounter_t pQueryPerformanceCounter = (QueryPerformanceCounter_t)
diff --git a/boost/interprocess/detail/workaround.hpp b/boost/interprocess/detail/workaround.hpp
index 53cd3eb2c4..ea92db7f35 100644
--- a/boost/interprocess/detail/workaround.hpp
+++ b/boost/interprocess/detail/workaround.hpp
@@ -49,17 +49,12 @@
//Cygwin defines _POSIX_THREAD_PROCESS_SHARED but does not implement it.
#if defined(__CYGWIN__)
#define BOOST_INTERPROCESS_BUGGY_POSIX_PROCESS_SHARED
- //Mac Os X < Lion (10.7) might define _POSIX_THREAD_PROCESS_SHARED but there is no real support.
#elif defined(__APPLE__)
- #include "TargetConditionals.h"
- //Check we're on Mac OS target
- #if defined(TARGET_OS_MAC)
- #include "AvailabilityMacros.h"
- //If minimum target for this compilation is older than Mac Os Lion, then we are out of luck
- #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
- #define BOOST_INTERPROCESS_BUGGY_POSIX_PROCESS_SHARED
- #endif
- #endif
+ //The pthreads implementation of darwin stores a pointer to a mutex inside the condition
+ //structure so real sharing between processes is broken. See:
+ //https://opensource.apple.com/source/libpthread/libpthread-301.30.1/src/pthread_cond.c.auto.html
+ //in method pthread_cond_wait
+ #define BOOST_INTERPROCESS_BUGGY_POSIX_PROCESS_SHARED
#endif
//If buggy _POSIX_THREAD_PROCESS_SHARED is detected avoid using it
diff --git a/boost/interprocess/errors.hpp b/boost/interprocess/errors.hpp
index 46dc417a59..f0198527a4 100644
--- a/boost/interprocess/errors.hpp
+++ b/boost/interprocess/errors.hpp
@@ -68,7 +68,7 @@ inline int system_error_code() // artifact of POSIX and WINDOWS error reporting
inline void fill_system_message(int sys_err_code, std::string &str)
{
void *lpMsgBuf;
- winapi::format_message(
+ unsigned long ret = winapi::format_message(
winapi::format_message_allocate_buffer |
winapi::format_message_from_system |
winapi::format_message_ignore_inserts,
@@ -79,11 +79,16 @@ inline void fill_system_message(int sys_err_code, std::string &str)
0,
0
);
- str += static_cast<const char*>(lpMsgBuf);
- winapi::local_free( lpMsgBuf ); // free the buffer
- while ( str.size()
- && (str[str.size()-1] == '\n' || str[str.size()-1] == '\r') )
- str.erase( str.size()-1 );
+ if (ret != 0){
+ str += static_cast<const char*>(lpMsgBuf);
+ winapi::local_free( lpMsgBuf ); // free the buffer
+ while ( str.size()
+ && (str[str.size()-1] == '\n' || str[str.size()-1] == '\r') )
+ str.erase( str.size()-1 );
+ }
+ else{
+ str += "WinApi FormatMessage returned error";
+ }
}
# else
inline void fill_system_message( int system_error, std::string &str)