Boost logo

Boost :

Subject: Re: [boost] [thread] Can't use boost/thread/mutex.hpp without boost_system
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-01-22 06:25:58


Le 22/01/12 12:10, Artyom Beilis a écrit :
>> From: Vicente J. Botet Escriba<vicente.botet_at_[hidden]>
>> Le 19/01/12 13:12, Artyom Beilis a écrit :
>>>> From: Anthony Williams<anthony.ajw_at_[hidden]>
>>>> On 18/01/12 14:01, Vicente Botet wrote:
>>>>> I was not aware that Boost.Thread was working as a header only
>> library.
>>>> This was a much-requested feature, so I made sure that boost::mutex at
>> least was
>>>> usable header-only.
>>>>
>> Oh, I remember that now.
>>> So would this be fixed or I should switch to lightweight mutex?
>>>
>>>
>> As far as Boost.System is not-header-only we can not have both:
>> boost::mutex header-only and compliant with c++11.
>> As said before, I could let the user the possibility to set Boost.Thread
>> to don't use Boost.System via BOOST_THREAD_DONT_USE_SYSTEM. Artyom,
>> Anthony is this satisfactory for you?
>>
>> Best,
>> Vicente
>>
>>
>
> Actually I don't really like using macro BOOST_THREAD_DONT_USE_SYSTEM,
> unless the boost-thread with and without it are **binary-compatible**.
>
> If it can't be done I'd rather prefer that Boost.Thread would require
> explicit linking.
>
> There is already too much problems with Boost ABI. Consider one
> part of library included<boost/thread/mutex.hpp> with
> BOOST_THREAD_DONT_USE_SYSTEM and some other without and linked
> with boost_thread. If this macro makes code binary incompatible
> it is bad and I don't think it should be used.
>
> There are enough problems with Boost API as it is and I don't
> think we would add more.
>
> In this case making lightweight mutexas part of public boost
> interface would be much better.
>
>
> I don't really care about linking with other library I just
> wanted to be consistent in my code. That's it.

You are right. A library should be header-only or not, but not both.

Let see if Boost.System could be moved to the set of header-only libraries.

If it is not the case, we will see what can be done with lightweight
mutexes.

On the meantime you will need to link with Boost.System :(

Best,
Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk