Re: [Boost-bugs] [Boost C++ Libraries] #8916: boost/signals2/detail/lwm_pthreads.hpp: Ignores all failures from pthread_* functions

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8916: boost/signals2/detail/lwm_pthreads.hpp: Ignores all failures from pthread_* functions
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-07-26 01:37:42


#8916: boost/signals2/detail/lwm_pthreads.hpp: Ignores all failures from pthread_*
functions
-------------------------------------+-------------------------------------
  Reporter: Jeffrey Walton | Owner: fmhess
  <noloader@…> | Status: new
      Type: Bugs | Component: signals2
 Milestone: To Be Determined | Severity: Problem
   Version: Boost 1.54.0 | Keywords: signals2 mutex pthread
Resolution: | API failure
-------------------------------------+-------------------------------------

Comment (by fmhess):

 Replying to [comment:3 Jeffrey Walton <noloader@…>]:
> As I understand it (please correct me), BOOST_VERIFY is simply
 BOOST_ASSERT without the side effect of removal when NDEBUG is defined
 [1]. That is:

 That's right. I'm guessing you're arguing that is not sufficient?
 According to the man pages, it is impossible for the pthread functions to
 return errors as I am using them, except by programmer error. Thus
 asserting seems good enough. This is also what boost.smart_ptr does
 (which is where I cribbed the mutex code from). Below is a paste of the
 pthread man page I'm referring to. I'm not using an error checking mutex,
 and I am initializing the mutex, so the only possible non-zero return
 value is if the mutex is destroyed while locked.


 RETURN VALUE
        pthread_mutex_init always returns 0. The other mutex functions
 return 0 on success and a non-zero error
        code on error.

 ERRORS
        The pthread_mutex_lock function returns the following error code on
 error:

               EINVAL the mutex has not been properly initialized.

               EDEADLK
                      the mutex is already locked by the calling thread
 (``error checking'' mutexes only).

        The pthread_mutex_trylock function returns the following error
 codes on error:

               EBUSY the mutex could not be acquired because it was
 currently locked.

               EINVAL the mutex has not been properly initialized.

        The pthread_mutex_unlock function returns the following error code
 on error:

               EINVAL the mutex has not been properly initialized.

               EPERM the calling thread does not own the mutex (``error
 checking'' mutexes only).

        The pthread_mutex_destroy function returns the following error code
 on error:

               EBUSY the mutex is currently locked.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8916#comment:4>
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:13 UTC