[Boost-bugs] [Boost C++ Libraries] #6292: native_handle_type missing on timed_mutex when BOOST_PTHREAD_HAS_TIMEDLOCK is not defined

Subject: [Boost-bugs] [Boost C++ Libraries] #6292: native_handle_type missing on timed_mutex when BOOST_PTHREAD_HAS_TIMEDLOCK is not defined
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-18 19:07:58


#6292: native_handle_type missing on timed_mutex when BOOST_PTHREAD_HAS_TIMEDLOCK
is not defined
------------------------------+---------------------------------------------
 Reporter: viboes | Owner: viboes
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
  Version: Boost 1.48.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 boost/pthread/mutex.hpp defines


 {{{
         typedef pthread_mutex_t* native_handle_type;
         native_handle_type native_handle()
         {
             return &m;
         }
 }}}


 only when BOOST_PTHREAD_HAS_TIMEDLOCK is defined.

 The following error occurs when trying to use them

 {{{
 clang-darwin.compile.c++
 ../../../bin.v2/libs/thread/test/v2_timed_mutex_native_handle_pass.test
 /clang-darwin-2.9x/debug/threading-
 multi/sync/mutual_exclusion/timed_mutex/native_handle_pass.o
 sync/mutual_exclusion/timed_mutex/native_handle_pass.cpp:29:23: error: no
 member named 'native_handle_type' in 'boost::timed_mutex'
   boost::timed_mutex::native_handle_type h = m.native_handle();
   ~~~~~~~~~~~~~~~~~~~~^

 }}}

 It seems to me that even some kind of handle must be returned by the
 native_handle function in this case.

 Maybe the return type could be a pointer to struct containing the
 implementation fields


 {{{
  struct native_handle_struct {
         pthread_mutex_t m;
         pthread_cond_t cond;
         bool is_locked;
  };
  typedef native_handle_struct* native_handle_type;
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6292>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC