Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-01 08:18:09

0001 //////////////////////////////////////////////////////////////////////////////
0002 //
0003 // (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
0004 // Software License, Version 1.0. (See accompanying file
0005 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // See http://www.boost.org/libs/interprocess for documentation.
0008 //
0009 //////////////////////////////////////////////////////////////////////////////
0010 
0011 #ifndef BOOST_INTERPROCESS_named_upgradable_mutex_HPP
0012 #define BOOST_INTERPROCESS_named_upgradable_mutex_HPP
0013 
0014 #ifndef BOOST_CONFIG_HPP
0015 #  include <boost/config.hpp>
0016 #endif
0017 #
0018 #if defined(BOOST_HAS_PRAGMA_ONCE)
0019 #  pragma once
0020 #endif
0021 
0022 #include <boost/interprocess/detail/config_begin.hpp>
0023 #include <boost/interprocess/detail/workaround.hpp>
0024 #include <boost/interprocess/creation_tags.hpp>
0025 #include <boost/interprocess/exceptions.hpp>
0026 #include <boost/interprocess/shared_memory_object.hpp>
0027 #include <boost/interprocess/detail/managed_open_or_create_impl.hpp>
0028 #include <boost/interprocess/sync/interprocess_upgradable_mutex.hpp>
0029 #include <boost/interprocess/sync/shm/named_creation_functor.hpp>
0030 #include <boost/interprocess/permissions.hpp>
0031 #include <boost/interprocess/timed_utils.hpp>
0032 
0033 //!\file
0034 //!Describes a named upgradable mutex class for inter-process synchronization
0035 
0036 namespace boost {
0037 namespace interprocess {
0038 
0039 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0040 namespace ipcdetail{ class interprocess_tester; }
0041 #endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
0042 
0043 class named_condition;
0044 
0045 //!A upgradable mutex with a global name, so it can be found from different
0046 //!processes. This mutex can't be placed in shared memory, and
0047 //!each process should have it's own named upgradable mutex.
0048 class named_upgradable_mutex
0049 {
0050    #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0051    //Non-copyable
0052    named_upgradable_mutex();
0053    named_upgradable_mutex(const named_upgradable_mutex &);
0054    named_upgradable_mutex &operator=(const named_upgradable_mutex &);
0055    friend class named_condition;
0056    #endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
0057    public:
0058 
0059    //!Creates a global upgradable mutex with a name.
0060    //!If the upgradable mutex can't be created throws interprocess_exception
0061    named_upgradable_mutex(create_only_t, const char *name, const permissions &perm = permissions());
0062 
0063    //!Opens or creates a global upgradable mutex with a name.
0064    //!If the upgradable mutex is created, this call is equivalent to
0065    //!named_upgradable_mutex(create_only_t, ...)
0066    //!If the upgradable mutex is already created, this call is equivalent to
0067    //!named_upgradable_mutex(open_only_t, ... ).
0068    named_upgradable_mutex(open_or_create_t, const char *name, const permissions &perm = permissions());
0069 
0070    //!Opens a global upgradable mutex with a name if that upgradable mutex
0071    //!is previously.
0072    //!created. If it is not previously created this function throws
0073    //!interprocess_exception.
0074    named_upgradable_mutex(open_only_t, const char *name);
0075 
0076    #if defined(BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES) || defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0077 
0078    //!Creates a global upgradable mutex with a name.
0079    //!If the upgradable mutex can't be created throws interprocess_exception
0080    //! 
0081    //!Note: This function is only available on operating systems with
0082    //!      native wchar_t APIs (e.g. Windows).
0083    named_upgradable_mutex(create_only_t, const wchar_t *name, const permissions &perm = permissions());
0084 
0085    //!Opens or creates a global upgradable mutex with a name.
0086    //!If the upgradable mutex is created, this call is equivalent to
0087    //!named_upgradable_mutex(create_only_t, ...)
0088    //!If the upgradable mutex is already created, this call is equivalent to
0089    //!named_upgradable_mutex(open_only_t, ... ).
0090    //! 
0091    //!Note: This function is only available on operating systems with
0092    //!      native wchar_t APIs (e.g. Windows).
0093    named_upgradable_mutex(open_or_create_t, const wchar_t *name, const permissions &perm = permissions());
0094 
0095    //!Opens a global upgradable mutex with a name if that upgradable mutex
0096    //!is previously.
0097    //!created. If it is not previously created this function throws
0098    //!interprocess_exception.
0099    //! 
0100    //!Note: This function is only available on operating systems with
0101    //!      native wchar_t APIs (e.g. Windows).
0102    named_upgradable_mutex(open_only_t, const wchar_t *name);
0103 
0104    #endif //defined(BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES) || defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0105 
0106    //!Destroys *this and indicates that the calling process is finished using
0107    //!the resource. The destructor function will deallocate
0108    //!any system resources allocated by the system for use by this process for
0109    //!this resource. The resource can still be opened again calling
0110    //!the open constructor overload. To erase the resource from the system
0111    //!use remove().
0112    ~named_upgradable_mutex();
0113 
0114    //Exclusive locking
0115 
0116    //!Requires: The calling thread does not own the mutex.
0117    //!
0118    //!Effects: The calling thread tries to obtain exclusive ownership of the mutex,
0119    //!   and if another thread has exclusive, sharable or upgradable ownership of
0120    //!   the mutex, it waits until it can obtain the ownership.
0121    //!Throws: interprocess_exception on error.
0122    //!
0123    //!Note: A program may deadlock if the thread that has ownership calls 
0124    //!   this function. If the implementation can detect the deadlock,
0125    //!   an exception could be thrown
0126    void lock();
0127 
0128    //!Requires: The calling thread does not own the mutex.
0129    //!
0130    //!Effects: The calling thread tries to acquire exclusive ownership of the mutex
0131    //!   without waiting. If no other thread has exclusive, sharable or upgradable
0132    //!   ownership of the mutex this succeeds.
0133    //!Returns: If it can acquire exclusive ownership immediately returns true.
0134    //!   If it has to wait, returns false.
0135    //!Throws: interprocess_exception on error.
0136    //!
0137    //!Note: A program may deadlock if the thread that has ownership calls 
0138    //!   this function. If the implementation can detect the deadlock,
0139    //!   an exception could be thrown
0140    bool try_lock();
0141 
0142    //!Requires: The calling thread does not own the mutex.
0143    //!
0144    //!Effects: The calling thread tries to acquire exclusive ownership of the mutex
0145    //!   waiting if necessary until no other thread has exclusive, sharable or
0146    //!   upgradable ownership of the mutex or abs_time is reached.
0147    //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
0148    //!Throws: interprocess_exception on error.
0149    //!
0150    //!Note: A program may deadlock if the thread that has ownership calls 
0151    //!   this function. If the implementation can detect the deadlock,
0152    //!   an exception could be thrown
0153    template<class TimePoint>
0154    bool timed_lock(const TimePoint &abs_time);
0155 
0156    //!Same as `timed_lock`, but this function is modeled after the
0157    //!standard library interface.
0158    template<class TimePoint> bool try_lock_until(const TimePoint &abs_time)
0159    {  return this->timed_lock(abs_time);  }
0160 
0161    //!Same as `timed_lock`, but this function is modeled after the
0162    //!standard library interface.
0163    template<class Duration>  bool try_lock_for(const Duration &dur)
0164    {  return this->timed_lock(ipcdetail::duration_to_ustime(dur)); }
0165 
0166    //!Precondition: The thread must have exclusive ownership of the mutex.
0167    //!Effects: The calling thread releases the exclusive ownership of the mutex.
0168    //!Throws: An exception derived from interprocess_exception on error.
0169    void unlock();
0170 
0171    //Sharable locking
0172 
0173    //!Requires: The calling thread does not own the mutex.
0174    //!
0175    //!Effects: The calling thread tries to obtain sharable ownership of the mutex,
0176    //!   and if another thread has exclusive ownership of the mutex,
0177    //!   waits until it can obtain the ownership.
0178    //!Throws: interprocess_exception on error.
0179    //!
0180    //!Note: A program may deadlock if the thread that has ownership calls 
0181    //!   this function. If the implementation can detect the deadlock,
0182    //!   an exception could be thrown
0183    void lock_sharable();
0184 
0185    //!Same as `lock_sharable` but with a std-compatible interface
0186    //! 
0187    void lock_shared()
0188    {  this->lock_sharable();  }
0189 
0190    //!Requires: The calling thread does not own the mutex.
0191    //!
0192    //!Effects: The calling thread tries to acquire sharable ownership of the mutex
0193    //!   without waiting. If no other thread has exclusive ownership
0194    //!   of the mutex this succeeds.
0195    //!Returns: If it can acquire sharable ownership immediately returns true. If it
0196    //!   has to wait, returns false.
0197    //!Throws: interprocess_exception on error.
0198    //!
0199    //!Note: A program may deadlock if the thread that has ownership calls 
0200    //!   this function. If the implementation can detect the deadlock,
0201    //!   an exception could be thrown
0202    bool try_lock_sharable();
0203 
0204    //!Same as `try_lock_sharable` but with a std-compatible interface
0205    //! 
0206    bool try_lock_shared()
0207    {  return this->try_lock_sharable();  }
0208 
0209    //!Requires: The calling thread does not own the mutex.
0210    //!
0211    //!Effects: The calling thread tries to acquire sharable ownership of the mutex
0212    //!   waiting if necessary until no other thread has exclusive
0213    //!   ownership of the mutex or abs_time is reached.
0214    //!Returns: If acquires sharable ownership, returns true. Otherwise returns false.
0215    //!Throws: interprocess_exception on error.
0216    //!
0217    //!Note: A program may deadlock if the thread that has ownership calls 
0218    //!   this function. If the implementation can detect the deadlock,
0219    //!   an exception could be thrown
0220    template<class TimePoint>
0221    bool timed_lock_sharable(const TimePoint &abs_time);
0222 
0223    //!Same as `timed_lock_sharable`, but this function is modeled after the
0224    //!standard library interface.
0225    template<class TimePoint> bool try_lock_shared_until(const TimePoint &abs_time)
0226    {  return this->timed_lock_sharable(abs_time);  }
0227 
0228    //!Same as `timed_lock_sharable`, but this function is modeled after the
0229    //!standard library interface.
0230    template<class Duration>  bool try_lock_shared_for(const Duration &dur)
0231    {  return this->timed_lock_sharable(ipcdetail::duration_to_ustime(dur)); }
0232 
0233    //!Precondition: The thread must have sharable ownership of the mutex.
0234    //!Effects: The calling thread releases the sharable ownership of the mutex.
0235    //!Throws: An exception derived from interprocess_exception on error.
0236    void unlock_sharable();
0237 
0238    //!Same as `unlock_sharable` but with a std-compatible interface
0239    //! 
0240    void unlock_shared()
0241    {  this->unlock_sharable();  }
0242 
0243    //Upgradable locking
0244 
0245    //!Requires: The calling thread does not own the mutex.
0246    //!
0247    //!Effects: The calling thread tries to obtain upgradable ownership of the mutex,
0248    //!   and if another thread has exclusive or upgradable ownership of the mutex,
0249    //!   waits until it can obtain the ownership.
0250    //!Throws: interprocess_exception on error.
0251    //!
0252    //!Note: A program may deadlock if the thread that has ownership calls 
0253    //!   this function. If the implementation can detect the deadlock,
0254    //!   an exception could be thrown
0255    void lock_upgradable();
0256 
0257    //!Requires: The calling thread does not own the mutex.
0258    //!
0259    //!Effects: The calling thread tries to acquire upgradable ownership of the mutex
0260    //!   without waiting. If no other thread has exclusive or upgradable ownership
0261    //!   of the mutex this succeeds.
0262    //!Returns: If it can acquire upgradable ownership immediately returns true.
0263    //!   If it has to wait, returns false.
0264    //!Throws: interprocess_exception on error.
0265    //!
0266    //!Note: A program may deadlock if the thread that has ownership calls 
0267    //!   this function. If the implementation can detect the deadlock,
0268    //!   an exception could be thrown
0269    bool try_lock_upgradable();
0270 
0271    //!Requires: The calling thread does not own the mutex.
0272    //!
0273    //!Effects: The calling thread tries to acquire upgradable ownership of the mutex
0274    //!   waiting if necessary until no other thread has exclusive or upgradable
0275    //!   ownership of the mutex or abs_time is reached.
0276    //!Returns: If acquires upgradable ownership, returns true. Otherwise returns false.
0277    //!Throws: interprocess_exception on error.
0278    //!
0279    //!Note: A program may deadlock if the thread that has ownership calls 
0280    //!   this function. If the implementation can detect the deadlock,
0281    //!   an exception could be thrown
0282    template<class TimePoint>
0283    bool timed_lock_upgradable(const TimePoint &abs_time);
0284 
0285    //!Precondition: The thread must have upgradable ownership of the mutex.
0286    //!Effects: The calling thread releases the upgradable ownership of the mutex.
0287    //!Throws: An exception derived from interprocess_exception on error.
0288    void unlock_upgradable();
0289 
0290    //Demotions
0291 
0292    //!Precondition: The thread must have exclusive ownership of the mutex.
0293    //!Effects: The thread atomically releases exclusive ownership and acquires
0294    //!   upgradable ownership. This operation is non-blocking.
0295    //!Throws: An exception derived from interprocess_exception on error.
0296    void unlock_and_lock_upgradable();
0297 
0298    //!Precondition: The thread must have exclusive ownership of the mutex.
0299    //!Effects: The thread atomically releases exclusive ownership and acquires
0300    //!   sharable ownership. This operation is non-blocking.
0301    //!Throws: An exception derived from interprocess_exception on error.
0302    void unlock_and_lock_sharable();
0303 
0304    //!Precondition: The thread must have upgradable ownership of the mutex.
0305    //!Effects: The thread atomically releases upgradable ownership and acquires
0306    //!   sharable ownership. This operation is non-blocking.
0307    //!Throws: An exception derived from interprocess_exception on error.
0308    void unlock_upgradable_and_lock_sharable();
0309 
0310    //Promotions
0311 
0312    //!Precondition: The thread must have upgradable ownership of the mutex.
0313    //!Effects: The thread atomically releases upgradable ownership and acquires
0314    //!   exclusive ownership. This operation will block until all threads with
0315    //!   sharable ownership release it.
0316    //!Throws: An exception derived from interprocess_exception on error.
0317    void unlock_upgradable_and_lock();
0318 
0319    //!Precondition: The thread must have upgradable ownership of the mutex.
0320    //!Effects: The thread atomically releases upgradable ownership and tries to
0321    //!   acquire exclusive ownership. This operation will fail if there are threads
0322    //!   with sharable ownership, but it will maintain upgradable ownership.
0323    //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
0324    //!Throws: An exception derived from interprocess_exception on error.
0325    bool try_unlock_upgradable_and_lock();
0326 
0327    //!Precondition: The thread must have upgradable ownership of the mutex.
0328    //!Effects: The thread atomically releases upgradable ownership and tries to acquire
0329    //!   exclusive ownership, waiting if necessary until abs_time. This operation will
0330    //!   fail if there are threads with sharable ownership or timeout reaches, but it
0331    //!   will maintain upgradable ownership.
0332    //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
0333    //!Throws: An exception derived from interprocess_exception on error.
0334    template<class TimePoint>
0335    bool timed_unlock_upgradable_and_lock(const TimePoint &abs_time);
0336 
0337    //!Precondition: The thread must have sharable ownership of the mutex.
0338    //!Effects: The thread atomically releases sharable ownership and tries to acquire
0339    //!   exclusive ownership. This operation will fail if there are threads with sharable
0340    //!   or upgradable ownership, but it will maintain sharable ownership.
0341    //!Returns: If acquires exclusive ownership, returns true. Otherwise returns false.
0342    //!Throws: An exception derived from interprocess_exception on error.
0343    bool try_unlock_sharable_and_lock();
0344 
0345    //!Precondition: The thread must have sharable ownership of the mutex.
0346    //!Effects: The thread atomically releases sharable ownership and tries to acquire
0347    //!   upgradable ownership. This operation will fail if there are threads with sharable
0348    //!   or upgradable ownership, but it will maintain sharable ownership.
0349    //!Returns: If acquires upgradable ownership, returns true. Otherwise returns false.
0350    //!Throws: An exception derived from interprocess_exception on error.
0351    bool try_unlock_sharable_and_lock_upgradable();
0352 
0353    //!Erases a named upgradable mutex from the system.
0354    //!Returns false on error. Never throws.
0355    static bool remove(const char *name);
0356 
0357    #if defined(BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES) || defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0358    //!Erases a named upgradable mutex from the system.
0359    //!Returns false on error. Never throws.
0360    //! 
0361    //!Note: This function is only available on operating systems with
0362    //!      native wchar_t APIs (e.g. Windows).
0363    static bool remove(const wchar_t *name);
0364    #endif
0365 
0366    #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0367    private:
0368    friend class ipcdetail::interprocess_tester;
0369    void dont_close_on_destruction();
0370 
0371    interprocess_upgradable_mutex *mutex() const
0372    {  return static_cast<interprocess_upgradable_mutex*>(m_shmem.get_user_address()); }
0373 
0374    typedef ipcdetail::managed_open_or_create_impl<shared_memory_object, 0, true, false> open_create_impl_t;
0375    open_create_impl_t m_shmem;
0376    typedef ipcdetail::named_creation_functor<interprocess_upgradable_mutex> construct_func_t;
0377    #endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
0378 };
0379 
0380 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0381 
0382 inline named_upgradable_mutex::~named_upgradable_mutex()
0383 {}
0384 
0385 inline named_upgradable_mutex::named_upgradable_mutex
0386    (create_only_t, const char *name, const permissions &perm)
0387    :  m_shmem  (create_only
0388                ,name
0389                ,sizeof(interprocess_upgradable_mutex) +
0390                   open_create_impl_t::ManagedOpenOrCreateUserOffset
0391                ,read_write
0392                ,0
0393                ,construct_func_t(ipcdetail::DoCreate)
0394                ,perm)
0395 {}
0396 
0397 inline named_upgradable_mutex::named_upgradable_mutex
0398    (open_or_create_t, const char *name, const permissions &perm)
0399    :  m_shmem  (open_or_create
0400                ,name
0401                ,sizeof(interprocess_upgradable_mutex) +
0402                   open_create_impl_t::ManagedOpenOrCreateUserOffset
0403                ,read_write
0404                ,0
0405                ,construct_func_t(ipcdetail::DoOpenOrCreate)
0406                ,perm)
0407 {}
0408 
0409 inline named_upgradable_mutex::named_upgradable_mutex
0410    (open_only_t, const char *name)
0411    :  m_shmem  (open_only
0412                ,name
0413                ,read_write
0414                ,0
0415                ,construct_func_t(ipcdetail::DoOpen))
0416 {}
0417 
0418 #if defined(BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES) || defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0419 
0420 inline named_upgradable_mutex::named_upgradable_mutex
0421    (create_only_t, const wchar_t *name, const permissions &perm)
0422    :  m_shmem  (create_only
0423                ,name
0424                ,sizeof(interprocess_upgradable_mutex) +
0425                   open_create_impl_t::ManagedOpenOrCreateUserOffset
0426                ,read_write
0427                ,0
0428                ,construct_func_t(ipcdetail::DoCreate)
0429                ,perm)
0430 {}
0431 
0432 inline named_upgradable_mutex::named_upgradable_mutex
0433    (open_or_create_t, const wchar_t *name, const permissions &perm)
0434    :  m_shmem  (open_or_create
0435                ,name
0436                ,sizeof(interprocess_upgradable_mutex) +
0437                   open_create_impl_t::ManagedOpenOrCreateUserOffset
0438                ,read_write
0439                ,0
0440                ,construct_func_t(ipcdetail::DoOpenOrCreate)
0441                ,perm)
0442 {}
0443 
0444 inline named_upgradable_mutex::named_upgradable_mutex
0445    (open_only_t, const wchar_t *name)
0446    :  m_shmem  (open_only
0447                ,name
0448                ,read_write
0449                ,0
0450                ,construct_func_t(ipcdetail::DoOpen))
0451 {}
0452 
0453 #endif
0454 
0455 inline void named_upgradable_mutex::dont_close_on_destruction()
0456 {  ipcdetail::interprocess_tester::dont_close_on_destruction(m_shmem);  }
0457 
0458 inline void named_upgradable_mutex::lock()
0459 {  this->mutex()->lock();  }
0460 
0461 inline void named_upgradable_mutex::unlock()
0462 {  this->mutex()->unlock();  }
0463 
0464 inline bool named_upgradable_mutex::try_lock()
0465 {  return this->mutex()->try_lock();  }
0466 
0467 template<class TimePoint>
0468 inline bool named_upgradable_mutex::timed_lock(const TimePoint &abs_time)
0469 {  return this->mutex()->timed_lock(abs_time);  }
0470 
0471 inline void named_upgradable_mutex::lock_upgradable()
0472 {  this->mutex()->lock_upgradable();  }
0473 
0474 inline void named_upgradable_mutex::unlock_upgradable()
0475 {  this->mutex()->unlock_upgradable();  }
0476 
0477 inline bool named_upgradable_mutex::try_lock_upgradable()
0478 {  return this->mutex()->try_lock_upgradable();  }
0479 
0480 template<class TimePoint>
0481 inline bool named_upgradable_mutex::timed_lock_upgradable(const TimePoint &abs_time)
0482 {  return this->mutex()->timed_lock_upgradable(abs_time);   }
0483 
0484 inline void named_upgradable_mutex::lock_sharable()
0485 {  this->mutex()->lock_sharable();  }
0486 
0487 inline void named_upgradable_mutex::unlock_sharable()
0488 {  this->mutex()->unlock_sharable();  }
0489 
0490 inline bool named_upgradable_mutex::try_lock_sharable()
0491 {  return this->mutex()->try_lock_sharable();  }
0492 
0493 template<class TimePoint>
0494 inline bool named_upgradable_mutex::timed_lock_sharable(const TimePoint &abs_time)
0495 {  return this->mutex()->timed_lock_sharable(abs_time);  }
0496 
0497 inline void named_upgradable_mutex::unlock_and_lock_upgradable()
0498 {  this->mutex()->unlock_and_lock_upgradable();  }
0499 
0500 inline void named_upgradable_mutex::unlock_and_lock_sharable()
0501 {  this->mutex()->unlock_and_lock_sharable();  }
0502 
0503 inline void named_upgradable_mutex::unlock_upgradable_and_lock_sharable()
0504 {  this->mutex()->unlock_upgradable_and_lock_sharable();  }
0505 
0506 inline void named_upgradable_mutex::unlock_upgradable_and_lock()
0507 {  this->mutex()->unlock_upgradable_and_lock();  }
0508 
0509 inline bool named_upgradable_mutex::try_unlock_upgradable_and_lock()
0510 {  return this->mutex()->try_unlock_upgradable_and_lock();  }
0511 
0512 template<class TimePoint>
0513 inline bool named_upgradable_mutex::timed_unlock_upgradable_and_lock(const TimePoint &abs_time)
0514 {  return this->mutex()->timed_unlock_upgradable_and_lock(abs_time);  }
0515 
0516 inline bool named_upgradable_mutex::try_unlock_sharable_and_lock()
0517 {  return this->mutex()->try_unlock_sharable_and_lock();  }
0518 
0519 inline bool named_upgradable_mutex::try_unlock_sharable_and_lock_upgradable()
0520 {  return this->mutex()->try_unlock_sharable_and_lock_upgradable();  }
0521 
0522 inline bool named_upgradable_mutex::remove(const char *name)
0523 {  return shared_memory_object::remove(name); }
0524 
0525 #if defined(BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES) || defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
0526 
0527 inline bool named_upgradable_mutex::remove(const wchar_t *name)
0528 {  return shared_memory_object::remove(name); }
0529 
0530 #endif
0531 
0532 
0533 #endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED
0534 
0535 }  //namespace interprocess {
0536 }  //namespace boost {
0537 
0538 #include <boost/interprocess/detail/config_end.hpp>
0539 
0540 #endif   //BOOST_INTERPROCESS_named_upgradable_mutex_HPP