Rename internal "windows_xxx" implementations to "winapi_xxx" implementation as public "windows_xxx" resources are native windows implementations, instead of POSIX emulations based on winapi system calls.

This commit is contained in:
Ion Gaztañaga
2021-02-13 23:27:50 +01:00
parent 26be575e66
commit 639afc2a59
26 changed files with 206 additions and 224 deletions

View File

@@ -31,16 +31,17 @@
#include <boost/limits.hpp>
#include <boost/assert.hpp>
#if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined(BOOST_INTERPROCESS_POSIX_PROCESS_SHARED)
#include <boost/interprocess/sync/posix/condition.hpp>
#define BOOST_INTERPROCESS_USE_POSIX
//Experimental...
#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
#include <boost/interprocess/sync/windows/condition.hpp>
#define BOOST_INTERPROCESS_USE_WINDOWS
#elif !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
#if defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION)
#include <boost/interprocess/sync/spin/condition.hpp>
#define BOOST_INTERPROCESS_USE_GENERIC_EMULATION
#elif defined(BOOST_INTERPROCESS_POSIX_PROCESS_SHARED)
#include <boost/interprocess/sync/posix/condition.hpp>
#define BOOST_INTERPROCESS_CONDITION_USE_POSIX
//Experimental...
#elif defined (BOOST_INTERPROCESS_WINDOWS)
#include <boost/interprocess/sync/windows/condition.hpp>
#define BOOST_INTERPROCESS_CONDITION_USE_WINAPI
#else
#error "Unsuported interprocess_condition"
#endif
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
@@ -141,18 +142,14 @@ class interprocess_condition
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
private:
#if defined (BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
#undef BOOST_INTERPROCESS_USE_GENERIC_EMULATION
ipcdetail::spin_condition m_condition;
#elif defined(BOOST_INTERPROCESS_USE_POSIX)
#undef BOOST_INTERPROCESS_USE_POSIX
#if defined(BOOST_INTERPROCESS_CONDITION_USE_POSIX)
ipcdetail::posix_condition m_condition;
#elif defined(BOOST_INTERPROCESS_USE_WINDOWS)
#undef BOOST_INTERPROCESS_USE_WINDOWS
ipcdetail::windows_condition m_condition;
#elif defined(BOOST_INTERPROCESS_CONDITION_USE_WINAPI)
ipcdetail::winapi_condition m_condition;
#else
#error "Unknown platform for interprocess_mutex"
ipcdetail::spin_condition m_condition;
#endif
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
};

View File

@@ -33,17 +33,8 @@
#include <boost/interprocess/sync/detail/common_algorithms.hpp>
#if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_POSIX_PROCESS_SHARED)
#include <boost/interprocess/sync/posix/mutex.hpp>
#define BOOST_INTERPROCESS_USE_POSIX
//Experimental...
#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
#include <boost/interprocess/sync/windows/mutex.hpp>
#define BOOST_INTERPROCESS_USE_WINDOWS
#elif !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
#if defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION)
#include <boost/interprocess/sync/spin/mutex.hpp>
#define BOOST_INTERPROCESS_USE_GENERIC_EMULATION
namespace boost {
namespace interprocess {
namespace ipcdetail{
@@ -54,6 +45,15 @@ class mutex_traits;
}}}}
#elif defined (BOOST_INTERPROCESS_POSIX_PROCESS_SHARED)
#include <boost/interprocess/sync/posix/mutex.hpp>
#define BOOST_INTERPROCESS_MUTEX_USE_POSIX
//Experimental...
#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
#define BOOST_INTERPROCESS_MUTEX_USE_WINAPI
#include <boost/interprocess/sync/windows/mutex.hpp>
#else
#error "Unsuported interprocess_mutex"
#endif
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
@@ -78,21 +78,16 @@ class interprocess_mutex
friend class interprocess_condition;
public:
#if defined(BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
#undef BOOST_INTERPROCESS_USE_GENERIC_EMULATION
#if defined(BOOST_INTERPROCESS_MUTEX_USE_POSIX)
typedef ipcdetail::posix_mutex internal_mutex_type;
#elif defined(BOOST_INTERPROCESS_MUTEX_USE_WINAPI)
typedef ipcdetail::winapi_mutex internal_mutex_type;
#else
typedef ipcdetail::spin_mutex internal_mutex_type;
private:
friend class ipcdetail::robust_emulation_helpers::mutex_traits<interprocess_mutex>;
void take_ownership(){ m_mutex.take_ownership(); }
public:
#elif defined(BOOST_INTERPROCESS_USE_POSIX)
#undef BOOST_INTERPROCESS_USE_POSIX
typedef ipcdetail::posix_mutex internal_mutex_type;
#elif defined(BOOST_INTERPROCESS_USE_WINDOWS)
#undef BOOST_INTERPROCESS_USE_WINDOWS
typedef ipcdetail::windows_mutex internal_mutex_type;
#else
#error "Unknown platform for interprocess_mutex"
#endif
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED

View File

@@ -43,20 +43,20 @@
#include <boost/interprocess/sync/detail/common_algorithms.hpp>
#include <boost/assert.hpp>
#if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && \
(defined(BOOST_INTERPROCESS_POSIX_PROCESS_SHARED) && defined (BOOST_INTERPROCESS_POSIX_RECURSIVE_MUTEXES))
#include <boost/interprocess/sync/posix/recursive_mutex.hpp>
#define BOOST_INTERPROCESS_USE_POSIX
//Experimental...
#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
#include <boost/interprocess/sync/windows/recursive_mutex.hpp>
#define BOOST_INTERPROCESS_USE_WINDOWS
#elif !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
#if defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION)
#include <boost/interprocess/sync/spin/recursive_mutex.hpp>
#define BOOST_INTERPROCESS_USE_GENERIC_EMULATION
#elif defined(BOOST_INTERPROCESS_POSIX_PROCESS_SHARED) && defined (BOOST_INTERPROCESS_POSIX_RECURSIVE_MUTEXES)
#include <boost/interprocess/sync/posix/recursive_mutex.hpp>
#define BOOST_INTERPROCESS_RECURSIVE_MUTEX_USE_POSIX
//Experimental...
#elif defined (BOOST_INTERPROCESS_WINDOWS)
#include <boost/interprocess/sync/windows/recursive_mutex.hpp>
#define BOOST_INTERPROCESS_RECURSIVE_MUTEX_USE_WINAPI
#else
#error "Unsuported interprocess_recursive_mutex"
#endif
#if defined (BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
#if defined (BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION)
namespace boost {
namespace interprocess {
namespace ipcdetail{
@@ -124,19 +124,14 @@ class interprocess_recursive_mutex
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
private:
#if defined (BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
#undef BOOST_INTERPROCESS_USE_GENERIC_EMULATION
#if defined(BOOST_INTERPROCESS_RECURSIVE_MUTEX_USE_POSIX)
ipcdetail::posix_recursive_mutex mutex;
#elif defined(BOOST_INTERPROCESS_RECURSIVE_MUTEX_USE_WINAPI)
ipcdetail::winapi_recursive_mutex mutex;
#else
void take_ownership(){ mutex.take_ownership(); }
friend class ipcdetail::robust_emulation_helpers::mutex_traits<interprocess_recursive_mutex>;
ipcdetail::spin_recursive_mutex mutex;
#elif defined(BOOST_INTERPROCESS_USE_POSIX)
#undef BOOST_INTERPROCESS_USE_POSIX
ipcdetail::posix_recursive_mutex mutex;
#elif defined(BOOST_INTERPROCESS_USE_WINDOWS)
#undef BOOST_INTERPROCESS_USE_WINDOWS
ipcdetail::windows_recursive_mutex mutex;
#else
#error "Unknown platform for interprocess_mutex"
#endif
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
};

View File

@@ -30,17 +30,17 @@
#include <boost/interprocess/sync/detail/locks.hpp>
#include <boost/interprocess/sync/detail/common_algorithms.hpp>
#if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && \
(defined(BOOST_INTERPROCESS_POSIX_PROCESS_SHARED) && defined(BOOST_INTERPROCESS_POSIX_UNNAMED_SEMAPHORES))
#include <boost/interprocess/sync/posix/semaphore.hpp>
#define BOOST_INTERPROCESS_USE_POSIX
//Experimental...
#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
#include <boost/interprocess/sync/windows/semaphore.hpp>
#define BOOST_INTERPROCESS_USE_WINDOWS
#elif !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
#if defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION)
#include <boost/interprocess/sync/spin/semaphore.hpp>
#define BOOST_INTERPROCESS_USE_GENERIC_EMULATION
#elif defined(BOOST_INTERPROCESS_POSIX_PROCESS_SHARED) && defined(BOOST_INTERPROCESS_POSIX_UNNAMED_SEMAPHORES)
#include <boost/interprocess/sync/posix/semaphore.hpp>
#define BOOST_INTERPROCESS_SEMAPHORE_USE_POSIX
#elif defined (BOOST_INTERPROCESS_WINDOWS)
//Experimental...
#include <boost/interprocess/sync/windows/semaphore.hpp>
#define BOOST_INTERPROCESS_SEMAPHORE_USE_WINAPI
#else
#error "Unsuported interprocess_semaphore"
#endif
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
@@ -95,16 +95,13 @@ class interprocess_semaphore
// int get_count() const;
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
private:
#if defined(BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
#undef BOOST_INTERPROCESS_USE_GENERIC_EMULATION
typedef ipcdetail::spin_semaphore internal_sem_t;
#elif defined(BOOST_INTERPROCESS_USE_WINDOWS)
#undef BOOST_INTERPROCESS_USE_WINDOWS
typedef ipcdetail::windows_semaphore internal_sem_t;
#else
#undef BOOST_INTERPROCESS_USE_POSIX
#if defined(BOOST_INTERPROCESS_SEMAPHORE_USE_POSIX)
typedef ipcdetail::posix_semaphore internal_sem_t;
#endif //#if defined(BOOST_INTERPROCESS_USE_GENERIC_EMULATION)
#elif defined(BOOST_INTERPROCESS_SEMAPHORE_USE_WINAPI)
typedef ipcdetail::winapi_semaphore internal_sem_t;
#else
typedef ipcdetail::spin_semaphore internal_sem_t;
#endif //#if defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION)
internal_sem_t m_sem;
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
};

View File

@@ -29,7 +29,7 @@
#include <boost/interprocess/sync/detail/locks.hpp>
#if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
#include <boost/interprocess/sync/windows/named_condition.hpp>
#define BOOST_INTERPROCESS_USE_WINDOWS
#define BOOST_INTERPROCESS_NAMED_CONDITION_USE_WINAPI
#else
#include <boost/interprocess/sync/shm/named_condition.hpp>
#endif
@@ -165,8 +165,8 @@ class named_condition
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
private:
#if defined(BOOST_INTERPROCESS_USE_WINDOWS)
typedef ipcdetail::windows_named_condition condition_type;
#if defined(BOOST_INTERPROCESS_NAMED_CONDITION_USE_WINAPI)
typedef ipcdetail::winapi_named_condition condition_type;
#else
typedef ipcdetail::shm_named_condition condition_type;
#endif

View File

@@ -29,7 +29,7 @@
#include <boost/interprocess/sync/detail/locks.hpp>
#if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
#include <boost/interprocess/sync/windows/named_condition_any.hpp>
#define BOOST_INTERPROCESS_USE_WINDOWS
#define BOOST_INTERPROCESS_NAMED_CONDITION_ANY_USE_WINAPI
#else
#include <boost/interprocess/sync/shm/named_condition_any.hpp>
#endif
@@ -183,8 +183,8 @@ class named_condition_any
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
private:
#if defined(BOOST_INTERPROCESS_USE_WINDOWS)
typedef ipcdetail::windows_named_condition_any condition_any_type;
#if defined(BOOST_INTERPROCESS_NAMED_CONDITION_ANY_USE_WINAPI)
typedef ipcdetail::winapi_named_condition_any condition_any_type;
#else
typedef ipcdetail::shm_named_condition_any condition_any_type;
#endif

View File

@@ -29,12 +29,12 @@
#if defined(BOOST_INTERPROCESS_NAMED_MUTEX_USES_POSIX_SEMAPHORES)
#include <boost/interprocess/sync/posix/named_mutex.hpp>
#define BOOST_INTERPROCESS_USE_POSIX_SEMAPHORES
#define BOOST_INTERPROCESS_NAMED_MUTEX_USE_POSIX
#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
#include <boost/interprocess/sync/windows/named_mutex.hpp>
#define BOOST_INTERPROCESS_USE_WINDOWS
#define BOOST_INTERPROCESS_NAMED_MUTEX_USE_WINAPI
#else
#include <boost/interprocess/sync/shm/named_mutex.hpp>
#include <boost/interprocess/sync/shm/named_mutex.hpp>
#endif
//!\file
@@ -154,12 +154,10 @@ class named_mutex
void dont_close_on_destruction();
public:
#if defined(BOOST_INTERPROCESS_USE_POSIX_SEMAPHORES)
#if defined(BOOST_INTERPROCESS_NAMED_MUTEX_USE_POSIX)
typedef ipcdetail::posix_named_mutex internal_mutex_type;
#undef BOOST_INTERPROCESS_USE_POSIX_SEMAPHORES
#elif defined(BOOST_INTERPROCESS_USE_WINDOWS)
typedef ipcdetail::windows_named_mutex internal_mutex_type;
#undef BOOST_INTERPROCESS_USE_WINDOWS
#elif defined(BOOST_INTERPROCESS_NAMED_MUTEX_USE_WINAPI)
typedef ipcdetail::winapi_named_mutex internal_mutex_type;
#else
typedef ipcdetail::shm_named_mutex internal_mutex_type;
#endif

View File

@@ -24,9 +24,10 @@
#include <boost/interprocess/creation_tags.hpp>
#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
#include <boost/interprocess/permissions.hpp>
#if !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
#include <boost/interprocess/sync/windows/named_recursive_mutex.hpp>
#define BOOST_INTERPROCESS_USE_WINDOWS
#define BOOST_INTERPROCESS_NAMED_RECURSIVE_MUTEX_USE_WINAPI
#else
#include <boost/interprocess/sync/shm/named_recursive_mutex.hpp>
#endif
@@ -145,9 +146,8 @@ class named_recursive_mutex
friend class ipcdetail::interprocess_tester;
void dont_close_on_destruction();
#if defined(BOOST_INTERPROCESS_USE_WINDOWS)
typedef ipcdetail::windows_named_recursive_mutex impl_t;
#undef BOOST_INTERPROCESS_USE_WINDOWS
#if defined(BOOST_INTERPROCESS_NAMED_RECURSIVE_MUTEX_USE_WINAPI)
typedef ipcdetail::winapi_named_recursive_mutex impl_t;
#else
typedef ipcdetail::shm_named_recursive_mutex impl_t;
#endif

View File

@@ -32,9 +32,9 @@
//Experimental...
#elif !defined(BOOST_INTERPROCESS_FORCE_GENERIC_EMULATION) && defined (BOOST_INTERPROCESS_WINDOWS)
#include <boost/interprocess/sync/windows/named_semaphore.hpp>
#define BOOST_INTERPROCESS_USE_WINDOWS
#define BOOST_INTERPROCESS_NAMED_SEMAPHORE_USE_WINAPI
#else
#include <boost/interprocess/sync/shm/named_semaphore.hpp>
#include <boost/interprocess/sync/shm/named_semaphore.hpp>
#endif
//!\file
@@ -156,8 +156,8 @@ class named_semaphore
#if defined(BOOST_INTERPROCESS_NAMED_SEMAPHORE_USES_POSIX_SEMAPHORES)
typedef ipcdetail::posix_named_semaphore impl_t;
#elif defined(BOOST_INTERPROCESS_USE_WINDOWS)
typedef ipcdetail::windows_named_semaphore impl_t;
#elif defined(BOOST_INTERPROCESS_NAMED_SEMAPHORE_USE_WINAPI)
typedef ipcdetail::winapi_named_semaphore impl_t;
#else
typedef ipcdetail::shm_named_semaphore impl_t;
#endif

View File

@@ -35,17 +35,17 @@ namespace boost {
namespace interprocess {
namespace ipcdetail {
class windows_condition
class winapi_condition
{
windows_condition(const windows_condition &);
windows_condition &operator=(const windows_condition &);
winapi_condition(const winapi_condition &);
winapi_condition &operator=(const winapi_condition &);
public:
windows_condition()
winapi_condition()
: m_condition_data()
{}
~windows_condition()
~winapi_condition()
{
//Notify all waiting threads
//to allow POSIX semantics on condition destruction
@@ -79,8 +79,8 @@ class windows_condition
struct condition_data
{
typedef boost::int32_t integer_type;
typedef windows_semaphore semaphore_type;
typedef windows_mutex mutex_type;
typedef winapi_semaphore semaphore_type;
typedef winapi_mutex mutex_type;
condition_data()
: m_nwaiters_blocked(0)

View File

@@ -33,14 +33,14 @@ namespace boost {
namespace interprocess {
namespace ipcdetail {
class windows_mutex
class winapi_mutex
{
windows_mutex(const windows_mutex &);
windows_mutex &operator=(const windows_mutex &);
winapi_mutex(const winapi_mutex &);
winapi_mutex &operator=(const winapi_mutex &);
public:
windows_mutex();
~windows_mutex();
winapi_mutex();
~winapi_mutex();
void lock();
bool try_lock();
@@ -52,7 +52,7 @@ class windows_mutex
const sync_id id_;
};
inline windows_mutex::windows_mutex()
inline winapi_mutex::winapi_mutex()
: id_(this)
{
sync_handles &handles =
@@ -66,14 +66,14 @@ inline windows_mutex::windows_mutex()
(void)open_or_created;
}
inline windows_mutex::~windows_mutex()
inline winapi_mutex::~winapi_mutex()
{
sync_handles &handles =
windows_intermodule_singleton<sync_handles>::get();
handles.destroy_handle(this->id_);
}
inline void windows_mutex::lock(void)
inline void winapi_mutex::lock(void)
{
sync_handles &handles =
windows_intermodule_singleton<sync_handles>::get();
@@ -82,7 +82,7 @@ inline void windows_mutex::lock(void)
mut.lock();
}
inline bool windows_mutex::try_lock(void)
inline bool winapi_mutex::try_lock(void)
{
sync_handles &handles =
windows_intermodule_singleton<sync_handles>::get();
@@ -91,7 +91,7 @@ inline bool windows_mutex::try_lock(void)
return mut.try_lock();
}
inline bool windows_mutex::timed_lock(const boost::posix_time::ptime &abs_time)
inline bool winapi_mutex::timed_lock(const boost::posix_time::ptime &abs_time)
{
sync_handles &handles =
windows_intermodule_singleton<sync_handles>::get();
@@ -100,7 +100,7 @@ inline bool windows_mutex::timed_lock(const boost::posix_time::ptime &abs_time)
return mut.timed_lock(abs_time);
}
inline void windows_mutex::unlock(void)
inline void winapi_mutex::unlock(void)
{
sync_handles &handles =
windows_intermodule_singleton<sync_handles>::get();

View File

@@ -27,7 +27,7 @@ namespace boost {
namespace interprocess {
namespace ipcdetail {
typedef windows_named_condition_any windows_named_condition;
typedef winapi_named_condition_any winapi_named_condition;
} //namespace ipcdetail {
} //namespace interprocess {

View File

@@ -68,18 +68,18 @@ struct named_cond_callbacks_str<wchar_t>
{ return L"_ul"; }
};
class windows_named_condition_any
class winapi_named_condition_any
{
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
//Non-copyable
windows_named_condition_any();
windows_named_condition_any(const windows_named_condition_any &);
windows_named_condition_any &operator=(const windows_named_condition_any &);
winapi_named_condition_any();
winapi_named_condition_any(const winapi_named_condition_any &);
winapi_named_condition_any &operator=(const winapi_named_condition_any &);
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
public:
windows_named_condition_any
winapi_named_condition_any
(create_only_t, const char *name, const permissions &perm = permissions())
: m_condition_data()
{
@@ -87,7 +87,7 @@ class windows_named_condition_any
m_named_sync.open_or_create(DoCreate, name, perm, callbacks);
}
windows_named_condition_any
winapi_named_condition_any
(open_or_create_t, const char *name, const permissions &perm = permissions())
: m_condition_data()
{
@@ -95,7 +95,7 @@ class windows_named_condition_any
m_named_sync.open_or_create(DoOpenOrCreate, name, perm, callbacks);
}
windows_named_condition_any(open_only_t, const char *name)
winapi_named_condition_any(open_only_t, const char *name)
: m_condition_data()
{
named_cond_callbacks callbacks(m_condition_data.get_members());
@@ -104,7 +104,7 @@ class windows_named_condition_any
#if defined(BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES) || defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
windows_named_condition_any
winapi_named_condition_any
(create_only_t, const wchar_t *name, const permissions &perm = permissions())
: m_condition_data()
{
@@ -112,7 +112,7 @@ class windows_named_condition_any
m_named_sync.open_or_create(DoCreate, name, perm, callbacks);
}
windows_named_condition_any
winapi_named_condition_any
(open_or_create_t, const wchar_t *name, const permissions &perm = permissions())
: m_condition_data()
{
@@ -120,7 +120,7 @@ class windows_named_condition_any
m_named_sync.open_or_create(DoOpenOrCreate, name, perm, callbacks);
}
windows_named_condition_any(open_only_t, const wchar_t *name)
winapi_named_condition_any(open_only_t, const wchar_t *name)
: m_condition_data()
{
named_cond_callbacks callbacks(m_condition_data.get_members());
@@ -129,7 +129,7 @@ class windows_named_condition_any
#endif //defined(BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES) || defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
~windows_named_condition_any()
~winapi_named_condition_any()
{
named_cond_callbacks callbacks(m_condition_data.get_members());
m_named_sync.close(callbacks);

View File

@@ -37,30 +37,30 @@ namespace ipcdetail {
class windows_named_mutex
class winapi_named_mutex
{
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
//Non-copyable
windows_named_mutex();
windows_named_mutex(const windows_named_mutex &);
windows_named_mutex &operator=(const windows_named_mutex &);
winapi_named_mutex();
winapi_named_mutex(const winapi_named_mutex &);
winapi_named_mutex &operator=(const winapi_named_mutex &);
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
public:
windows_named_mutex(create_only_t, const char *name, const permissions &perm = permissions());
winapi_named_mutex(create_only_t, const char *name, const permissions &perm = permissions());
windows_named_mutex(open_or_create_t, const char *name, const permissions &perm = permissions());
winapi_named_mutex(open_or_create_t, const char *name, const permissions &perm = permissions());
windows_named_mutex(open_only_t, const char *name);
winapi_named_mutex(open_only_t, const char *name);
windows_named_mutex(create_only_t, const wchar_t *name, const permissions &perm = permissions());
winapi_named_mutex(create_only_t, const wchar_t *name, const permissions &perm = permissions());
windows_named_mutex(open_or_create_t, const wchar_t *name, const permissions &perm = permissions());
winapi_named_mutex(open_or_create_t, const wchar_t *name, const permissions &perm = permissions());
windows_named_mutex(open_only_t, const wchar_t *name);
winapi_named_mutex(open_only_t, const wchar_t *name);
~windows_named_mutex();
~winapi_named_mutex();
void unlock();
void lock();
@@ -131,16 +131,16 @@ class windows_named_mutex
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
};
inline windows_named_mutex::~windows_named_mutex()
inline winapi_named_mutex::~winapi_named_mutex()
{
named_mut_callbacks callbacks(m_mtx_wrapper);
m_named_sync.close(callbacks);
}
inline void windows_named_mutex::dont_close_on_destruction()
inline void winapi_named_mutex::dont_close_on_destruction()
{}
inline windows_named_mutex::windows_named_mutex
inline winapi_named_mutex::winapi_named_mutex
(create_only_t, const char *name, const permissions &perm)
: m_mtx_wrapper()
{
@@ -148,7 +148,7 @@ inline windows_named_mutex::windows_named_mutex
m_named_sync.open_or_create(DoCreate, name, perm, callbacks);
}
inline windows_named_mutex::windows_named_mutex
inline winapi_named_mutex::winapi_named_mutex
(open_or_create_t, const char *name, const permissions &perm)
: m_mtx_wrapper()
{
@@ -156,14 +156,14 @@ inline windows_named_mutex::windows_named_mutex
m_named_sync.open_or_create(DoOpenOrCreate, name, perm, callbacks);
}
inline windows_named_mutex::windows_named_mutex(open_only_t, const char *name)
inline winapi_named_mutex::winapi_named_mutex(open_only_t, const char *name)
: m_mtx_wrapper()
{
named_mut_callbacks callbacks(m_mtx_wrapper);
m_named_sync.open_or_create(DoOpen, name, permissions(), callbacks);
}
inline windows_named_mutex::windows_named_mutex
inline winapi_named_mutex::winapi_named_mutex
(create_only_t, const wchar_t *name, const permissions &perm)
: m_mtx_wrapper()
{
@@ -171,7 +171,7 @@ inline windows_named_mutex::windows_named_mutex
m_named_sync.open_or_create(DoCreate, name, perm, callbacks);
}
inline windows_named_mutex::windows_named_mutex
inline winapi_named_mutex::winapi_named_mutex
(open_or_create_t, const wchar_t *name, const permissions &perm)
: m_mtx_wrapper()
{
@@ -179,39 +179,39 @@ inline windows_named_mutex::windows_named_mutex
m_named_sync.open_or_create(DoOpenOrCreate, name, perm, callbacks);
}
inline windows_named_mutex::windows_named_mutex(open_only_t, const wchar_t *name)
inline winapi_named_mutex::winapi_named_mutex(open_only_t, const wchar_t *name)
: m_mtx_wrapper()
{
named_mut_callbacks callbacks(m_mtx_wrapper);
m_named_sync.open_or_create(DoOpen, name, permissions(), callbacks);
}
inline void windows_named_mutex::unlock()
inline void winapi_named_mutex::unlock()
{
m_mtx_wrapper.unlock();
}
inline void windows_named_mutex::lock()
inline void winapi_named_mutex::lock()
{
m_mtx_wrapper.lock();
}
inline bool windows_named_mutex::try_lock()
inline bool winapi_named_mutex::try_lock()
{
return m_mtx_wrapper.try_lock();
}
inline bool windows_named_mutex::timed_lock(const boost::posix_time::ptime &abs_time)
inline bool winapi_named_mutex::timed_lock(const boost::posix_time::ptime &abs_time)
{
return m_mtx_wrapper.timed_lock(abs_time);
}
inline bool windows_named_mutex::remove(const char *name)
inline bool winapi_named_mutex::remove(const char *name)
{
return windows_named_sync::remove(name);
}
inline bool windows_named_mutex::remove(const wchar_t *name)
inline bool winapi_named_mutex::remove(const wchar_t *name)
{
return windows_named_sync::remove(name);
}

View File

@@ -27,41 +27,41 @@ namespace interprocess {
namespace ipcdetail {
class windows_named_recursive_mutex
class winapi_named_recursive_mutex
//Windows mutexes based on CreateMutex are already recursive...
: public windows_named_mutex
: public winapi_named_mutex
{
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
//Non-copyable
windows_named_recursive_mutex();
windows_named_recursive_mutex(const windows_named_mutex &);
windows_named_recursive_mutex &operator=(const windows_named_mutex &);
winapi_named_recursive_mutex();
winapi_named_recursive_mutex(const winapi_named_mutex &);
winapi_named_recursive_mutex &operator=(const winapi_named_mutex &);
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
public:
windows_named_recursive_mutex(create_only_t, const char *name, const permissions &perm = permissions())
: windows_named_mutex(create_only_t(), name, perm)
winapi_named_recursive_mutex(create_only_t, const char *name, const permissions &perm = permissions())
: winapi_named_mutex(create_only_t(), name, perm)
{}
windows_named_recursive_mutex(open_or_create_t, const char *name, const permissions &perm = permissions())
: windows_named_mutex(open_or_create_t(), name, perm)
winapi_named_recursive_mutex(open_or_create_t, const char *name, const permissions &perm = permissions())
: winapi_named_mutex(open_or_create_t(), name, perm)
{}
windows_named_recursive_mutex(open_only_t, const char *name)
: windows_named_mutex(open_only_t(), name)
winapi_named_recursive_mutex(open_only_t, const char *name)
: winapi_named_mutex(open_only_t(), name)
{}
windows_named_recursive_mutex(create_only_t, const wchar_t *name, const permissions &perm = permissions())
: windows_named_mutex(create_only_t(), name, perm)
winapi_named_recursive_mutex(create_only_t, const wchar_t *name, const permissions &perm = permissions())
: winapi_named_mutex(create_only_t(), name, perm)
{}
windows_named_recursive_mutex(open_or_create_t, const wchar_t *name, const permissions &perm = permissions())
: windows_named_mutex(open_or_create_t(), name, perm)
winapi_named_recursive_mutex(open_or_create_t, const wchar_t *name, const permissions &perm = permissions())
: winapi_named_mutex(open_or_create_t(), name, perm)
{}
windows_named_recursive_mutex(open_only_t, const wchar_t *name)
: windows_named_mutex(open_only_t(), name)
winapi_named_recursive_mutex(open_only_t, const wchar_t *name)
: winapi_named_mutex(open_only_t(), name)
{}
};

View File

@@ -34,30 +34,30 @@ namespace ipcdetail {
class windows_named_semaphore
class winapi_named_semaphore
{
#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
//Non-copyable
windows_named_semaphore();
windows_named_semaphore(const windows_named_semaphore &);
windows_named_semaphore &operator=(const windows_named_semaphore &);
winapi_named_semaphore();
winapi_named_semaphore(const winapi_named_semaphore &);
winapi_named_semaphore &operator=(const winapi_named_semaphore &);
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
public:
windows_named_semaphore(create_only_t, const char *name, unsigned int initialCount, const permissions &perm = permissions());
winapi_named_semaphore(create_only_t, const char *name, unsigned int initialCount, const permissions &perm = permissions());
windows_named_semaphore(open_or_create_t, const char *name, unsigned int initialCount, const permissions &perm = permissions());
winapi_named_semaphore(open_or_create_t, const char *name, unsigned int initialCount, const permissions &perm = permissions());
windows_named_semaphore(open_only_t, const char *name);
winapi_named_semaphore(open_only_t, const char *name);
windows_named_semaphore(create_only_t, const wchar_t *name, unsigned int initialCount, const permissions &perm = permissions());
winapi_named_semaphore(create_only_t, const wchar_t *name, unsigned int initialCount, const permissions &perm = permissions());
windows_named_semaphore(open_or_create_t, const wchar_t *name, unsigned int initialCount, const permissions &perm = permissions());
winapi_named_semaphore(open_or_create_t, const wchar_t *name, unsigned int initialCount, const permissions &perm = permissions());
windows_named_semaphore(open_only_t, const wchar_t *name);
winapi_named_semaphore(open_only_t, const wchar_t *name);
~windows_named_semaphore();
~winapi_named_semaphore();
void post();
void wait();
@@ -136,16 +136,16 @@ class windows_named_semaphore
#endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
};
inline windows_named_semaphore::~windows_named_semaphore()
inline winapi_named_semaphore::~winapi_named_semaphore()
{
named_sem_callbacks callbacks(m_sem_wrapper, m_sem_wrapper.value());
m_named_sync.close(callbacks);
}
inline void windows_named_semaphore::dont_close_on_destruction()
inline void winapi_named_semaphore::dont_close_on_destruction()
{}
inline windows_named_semaphore::windows_named_semaphore
inline winapi_named_semaphore::winapi_named_semaphore
(create_only_t, const char *name, unsigned int initial_count, const permissions &perm)
: m_sem_wrapper()
{
@@ -153,7 +153,7 @@ inline windows_named_semaphore::windows_named_semaphore
m_named_sync.open_or_create(DoCreate, name, perm, callbacks);
}
inline windows_named_semaphore::windows_named_semaphore
inline winapi_named_semaphore::winapi_named_semaphore
(open_or_create_t, const char *name, unsigned int initial_count, const permissions &perm)
: m_sem_wrapper()
{
@@ -161,14 +161,14 @@ inline windows_named_semaphore::windows_named_semaphore
m_named_sync.open_or_create(DoOpenOrCreate, name, perm, callbacks);
}
inline windows_named_semaphore::windows_named_semaphore(open_only_t, const char *name)
inline winapi_named_semaphore::winapi_named_semaphore(open_only_t, const char *name)
: m_sem_wrapper()
{
named_sem_callbacks callbacks(m_sem_wrapper, 0);
m_named_sync.open_or_create(DoOpen, name, permissions(), callbacks);
}
inline windows_named_semaphore::windows_named_semaphore
inline winapi_named_semaphore::winapi_named_semaphore
(create_only_t, const wchar_t *name, unsigned int initial_count, const permissions &perm)
: m_sem_wrapper()
{
@@ -176,7 +176,7 @@ inline windows_named_semaphore::windows_named_semaphore
m_named_sync.open_or_create(DoCreate, name, perm, callbacks);
}
inline windows_named_semaphore::windows_named_semaphore
inline winapi_named_semaphore::winapi_named_semaphore
(open_or_create_t, const wchar_t *name, unsigned int initial_count, const permissions &perm)
: m_sem_wrapper()
{
@@ -184,39 +184,39 @@ inline windows_named_semaphore::windows_named_semaphore
m_named_sync.open_or_create(DoOpenOrCreate, name, perm, callbacks);
}
inline windows_named_semaphore::windows_named_semaphore(open_only_t, const wchar_t *name)
inline winapi_named_semaphore::winapi_named_semaphore(open_only_t, const wchar_t *name)
: m_sem_wrapper()
{
named_sem_callbacks callbacks(m_sem_wrapper, 0);
m_named_sync.open_or_create(DoOpen, name, permissions(), callbacks);
}
inline void windows_named_semaphore::post()
inline void winapi_named_semaphore::post()
{
m_sem_wrapper.post();
}
inline void windows_named_semaphore::wait()
inline void winapi_named_semaphore::wait()
{
m_sem_wrapper.wait();
}
inline bool windows_named_semaphore::try_wait()
inline bool winapi_named_semaphore::try_wait()
{
return m_sem_wrapper.try_wait();
}
inline bool windows_named_semaphore::timed_wait(const boost::posix_time::ptime &abs_time)
inline bool winapi_named_semaphore::timed_wait(const boost::posix_time::ptime &abs_time)
{
return m_sem_wrapper.timed_wait(abs_time);
}
inline bool windows_named_semaphore::remove(const char *name)
inline bool winapi_named_semaphore::remove(const char *name)
{
return windows_named_sync::remove(name);
}
inline bool windows_named_semaphore::remove(const wchar_t *name)
inline bool winapi_named_semaphore::remove(const wchar_t *name)
{
return windows_named_sync::remove(name);
}

View File

@@ -28,13 +28,13 @@ namespace interprocess {
namespace ipcdetail {
//Windows mutex is already recursive
class windows_recursive_mutex
: public windows_mutex
class winapi_recursive_mutex
: public winapi_mutex
{
windows_recursive_mutex(const windows_recursive_mutex &);
windows_recursive_mutex &operator=(const windows_recursive_mutex &);
winapi_recursive_mutex(const winapi_recursive_mutex &);
winapi_recursive_mutex &operator=(const winapi_recursive_mutex &);
public:
windows_recursive_mutex() : windows_mutex() {}
winapi_recursive_mutex() : winapi_mutex() {}
};
} //namespace ipcdetail {

View File

@@ -34,14 +34,14 @@ namespace boost {
namespace interprocess {
namespace ipcdetail {
class windows_semaphore
class winapi_semaphore
{
windows_semaphore(const windows_semaphore &);
windows_semaphore &operator=(const windows_semaphore &);
winapi_semaphore(const winapi_semaphore &);
winapi_semaphore &operator=(const winapi_semaphore &);
public:
windows_semaphore(unsigned int initialCount);
~windows_semaphore();
winapi_semaphore(unsigned int initialCount);
~winapi_semaphore();
void post(unsigned int release_count = 1);
void wait();
@@ -53,7 +53,7 @@ class windows_semaphore
const unsigned initial_count_;
};
inline windows_semaphore::windows_semaphore(unsigned int initialCount)
inline winapi_semaphore::winapi_semaphore(unsigned int initialCount)
: id_(this), initial_count_(initialCount)
{
sync_handles &handles =
@@ -67,14 +67,14 @@ inline windows_semaphore::windows_semaphore(unsigned int initialCount)
(void)open_or_created;
}
inline windows_semaphore::~windows_semaphore()
inline winapi_semaphore::~winapi_semaphore()
{
sync_handles &handles =
windows_intermodule_singleton<sync_handles>::get();
handles.destroy_handle(this->id_);
}
inline void windows_semaphore::wait()
inline void winapi_semaphore::wait()
{
sync_handles &handles =
windows_intermodule_singleton<sync_handles>::get();
@@ -83,7 +83,7 @@ inline void windows_semaphore::wait()
sem.wait();
}
inline bool windows_semaphore::try_wait()
inline bool winapi_semaphore::try_wait()
{
sync_handles &handles =
windows_intermodule_singleton<sync_handles>::get();
@@ -92,7 +92,7 @@ inline bool windows_semaphore::try_wait()
return sem.try_wait();
}
inline bool windows_semaphore::timed_wait(const boost::posix_time::ptime &abs_time)
inline bool winapi_semaphore::timed_wait(const boost::posix_time::ptime &abs_time)
{
sync_handles &handles =
windows_intermodule_singleton<sync_handles>::get();
@@ -101,7 +101,7 @@ inline bool windows_semaphore::timed_wait(const boost::posix_time::ptime &abs_ti
return sem.timed_wait(abs_time);
}
inline void windows_semaphore::post(unsigned release_count)
inline void winapi_semaphore::post(unsigned release_count)
{
sync_handles &handles =
windows_intermodule_singleton<sync_handles>::get();

View File

@@ -25,7 +25,7 @@ using namespace boost::interprocess;
int main ()
{
#if defined(BOOST_INTERPROCESS_WINDOWS)
if(!test::do_test_condition<ipcdetail::windows_condition, ipcdetail::windows_mutex>())
if(!test::do_test_condition<ipcdetail::winapi_condition, ipcdetail::winapi_mutex>())
return 1;
if(!test::do_test_condition<ipcdetail::spin_condition, ipcdetail::spin_mutex>())
return 1;

View File

@@ -22,8 +22,8 @@ int main ()
using namespace boost::interprocess;
#if defined(BOOST_INTERPROCESS_WINDOWS)
test::test_all_lock<ipcdetail::windows_mutex>();
test::test_all_mutex<ipcdetail::windows_mutex>();
test::test_all_lock<ipcdetail::winapi_mutex>();
test::test_all_mutex<ipcdetail::winapi_mutex>();
test::test_all_lock<ipcdetail::spin_mutex>();
test::test_all_mutex<ipcdetail::spin_mutex>();
#endif

View File

@@ -29,7 +29,7 @@ int main()
{
int ret;
#if defined(BOOST_INTERPROCESS_WINDOWS)
ret = test::test_named_condition<ipcdetail::windows_named_condition_any, ipcdetail::windows_named_mutex>();
ret = test::test_named_condition<ipcdetail::winapi_named_condition_any, ipcdetail::winapi_named_mutex>();
if (ret)
return ret;
#endif

View File

@@ -29,7 +29,7 @@ int main()
{
int ret;
#if defined(BOOST_INTERPROCESS_WINDOWS)
ret = test::test_named_condition<ipcdetail::windows_named_condition, ipcdetail::windows_named_mutex>();
ret = test::test_named_condition<ipcdetail::winapi_named_condition, ipcdetail::winapi_named_mutex>();
if (ret)
return ret;
#endif

View File

@@ -46,7 +46,7 @@ int main()
{
int ret;
#if defined(BOOST_INTERPROCESS_WINDOWS)
ret = test_named_mutex<ipcdetail::windows_named_mutex>();
ret = test_named_mutex<ipcdetail::winapi_named_mutex>();
if (ret)
return ret;
#endif

View File

@@ -49,7 +49,7 @@ int main()
{
int ret;
#if defined(BOOST_INTERPROCESS_WINDOWS)
ret = test_named_recursive_mutex<ipcdetail::windows_named_recursive_mutex>();
ret = test_named_recursive_mutex<ipcdetail::winapi_named_recursive_mutex>();
if (ret)
return ret;
#endif

View File

@@ -137,7 +137,7 @@ int main()
{
int ret;
#if defined(BOOST_INTERPROCESS_WINDOWS)
ret = test_named_semaphore<ipcdetail::windows_named_semaphore>();
ret = test_named_semaphore<ipcdetail::winapi_named_semaphore>();
if (ret)
return ret;
#endif

View File

@@ -22,9 +22,9 @@ int main ()
using namespace boost::interprocess;
#if defined(BOOST_INTERPROCESS_WINDOWS)
//
test::test_all_lock<ipcdetail::windows_recursive_mutex>();
test::test_all_mutex<ipcdetail::windows_recursive_mutex>();
test::test_all_recursive_lock<ipcdetail::windows_recursive_mutex>();
test::test_all_lock<ipcdetail::winapi_recursive_mutex>();
test::test_all_mutex<ipcdetail::winapi_recursive_mutex>();
test::test_all_recursive_lock<ipcdetail::winapi_recursive_mutex>();
//
test::test_all_lock<ipcdetail::spin_recursive_mutex>();
test::test_all_mutex<ipcdetail::spin_recursive_mutex>();