|
Boost Users : |
Subject: Re: [Boost-users] [thread] Error checking mutex
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2016-08-31 17:51:41
Le 31/08/2016 à 18:37, Paul Fee a écrit :
> Hi all,
>
> When using pthread mutexes a number of types are available (man
> pthread_mutexattr_settype). The normal and recursive types are
> exposed via boost as boost::mutex and boost::recursive_mutex. I'd
> like to use PTHREAD_MUTEX_ERRORCHECK mutexes but don't see such a
> mutex type within boost or C++ std namespaces. I'm wondering why this
> C feature is not exposed to C++ users. Are there plans to do so? Has
> it been omitted because this POSIX feature is not portable to other
> platforms?
>
No there are no plans. I understand that could be useful for POSIX
platforms, but you should have a portable solution for other platforms.
> For experimentation purposes I've duplicated then modified the code
> from boost/thread/recursive_mutex.hpp and
> boost/thread/pthread/recursive_mutex.hpp to create
> errorcheck_mutex.hpp on my Fedora 24 system and it gives me the error
> checking functionality I'm after. Is this a reasonable approach to
> plug the gap in Boost or is there a reason not to do so?
>
Good initiative. I believe that we could start by an implementation for
POSIX. We will need the code, tests and updated documentation. It will
be even best if you fork the github repository and propose a PR.
Best,
Vicente
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net