DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2005-2008. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/interprocess for documentation. // ////////////////////////////////////////////////////////////////////////////// #ifndef BOOST_INTERPROCESS_PTHREAD_HELPERS_HPP #define BOOST_INTERPROCESS_PTHREAD_HELPERS_HPP #if (defined _MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif #include
#include
#include
#include
#include
namespace boost { namespace interprocess { namespace detail{ #if defined BOOST_INTERPROCESS_POSIX_PROCESS_SHARED //!Makes pthread_mutexattr_t cleanup easy when using exceptions struct mutexattr_wrapper { //!Constructor mutexattr_wrapper(bool recursive = false) { if(pthread_mutexattr_init(&m_attr)!=0 || pthread_mutexattr_setpshared(&m_attr, PTHREAD_PROCESS_SHARED)!= 0 || (recursive && pthread_mutexattr_settype(&m_attr, PTHREAD_MUTEX_RECURSIVE)!= 0 )) throw boost::interprocess::interprocess_exception(); } //!Destructor ~mutexattr_wrapper() { pthread_mutexattr_destroy(&m_attr); } //!This allows using mutexattr_wrapper as pthread_mutexattr_t operator pthread_mutexattr_t&() { return m_attr; } pthread_mutexattr_t m_attr; }; //!Makes pthread_condattr_t cleanup easy when using exceptions struct condattr_wrapper { //!Constructor condattr_wrapper() { if(pthread_condattr_init(&m_attr)!=0 || pthread_condattr_setpshared(&m_attr, PTHREAD_PROCESS_SHARED)!= 0) throw boost::interprocess::interprocess_exception(); } //!Destructor ~condattr_wrapper() { pthread_condattr_destroy(&m_attr); } //!This allows using condattr_wrapper as pthread_condattr_t operator pthread_condattr_t&(){ return m_attr; } pthread_condattr_t m_attr; }; //!Makes initialized pthread_mutex_t cleanup easy when using exceptions class mutex_initializer { public: //!Constructor. Takes interprocess_mutex attributes to initialize the interprocess_mutex mutex_initializer(pthread_mutex_t &mut, pthread_mutexattr_t &mut_attr) : mp_mut(&mut) { if(pthread_mutex_init(mp_mut, &mut_attr) != 0) throw boost::interprocess::interprocess_exception(); } ~mutex_initializer() { if(mp_mut) pthread_mutex_destroy(mp_mut); } void release() {mp_mut = 0; } private: pthread_mutex_t *mp_mut; }; //!Makes initialized pthread_cond_t cleanup easy when using exceptions class condition_initializer { public: condition_initializer(pthread_cond_t &cond, pthread_condattr_t &cond_attr) : mp_cond(&cond) { if(pthread_cond_init(mp_cond, &cond_attr)!= 0) throw boost::interprocess::interprocess_exception(); } ~condition_initializer() { if(mp_cond) pthread_cond_destroy(mp_cond); } void release() { mp_cond = 0; } private: pthread_cond_t *mp_cond; }; #endif // #if defined BOOST_INTERPROCESS_POSIX_PROCESS_SHARED #if defined(BOOST_INTERPROCESS_POSIX_BARRIERS) && defined(BOOST_INTERPROCESS_POSIX_PROCESS_SHARED) //!Makes pthread_barrierattr_t cleanup easy when using exceptions struct barrierattr_wrapper { //!Constructor barrierattr_wrapper() { if(pthread_barrierattr_init(&m_attr)!=0 || pthread_barrierattr_setpshared(&m_attr, PTHREAD_PROCESS_SHARED)!= 0) throw boost::interprocess::interprocess_exception(); } //!Destructor ~barrierattr_wrapper() { pthread_barrierattr_destroy(&m_attr); } //!This allows using mutexattr_wrapper as pthread_barrierattr_t operator pthread_barrierattr_t&() { return m_attr; } pthread_barrierattr_t m_attr; }; //!Makes initialized pthread_barrier_t cleanup easy when using exceptions class barrier_initializer { public: //!Constructor. Takes barrier attributes to initialize the barrier barrier_initializer(pthread_barrier_t &mut, pthread_barrierattr_t &mut_attr, int count) : mp_barrier(&mut) { if(pthread_barrier_init(mp_barrier, &mut_attr, count) != 0) throw boost::interprocess::interprocess_exception(); } ~barrier_initializer() { if(mp_barrier) pthread_barrier_destroy(mp_barrier); } void release() {mp_barrier = 0; } private: pthread_barrier_t *mp_barrier; }; #endif //#if defined(BOOST_INTERPROCESS_POSIX_BARRIERS) && defined(BOOST_INTERPROCESS_POSIX_PROCESS_SHARED) }//namespace detail }//namespace interprocess }//namespace boost #include
#endif //ifdef BOOST_INTERPROCESS_PTHREAD_HELPERS_HPP
pthread_helpers.hpp
Page URL
File URL
Prev
6/8
Next
Download
( 5 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.