Boost logo

Boost :

From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2006-07-25 09:21:40


Hi Beman,

Beman Dawes <bdawes_at_[hidden]> wrote:
>"Christopher Kohlhoff" <chris_at_[hidden]> wrote in message
>> - The Jamfile is doing something strange when I try to link the
>> boost_system library from the asio unit test Jamfile, but it
>> works fine when used from non-test Jamfiles.
>
> Hum.... Not sure what to make of that. What error are you getting?

After a bit more investigation I think it isn't to do with the
system library at all. Nothing for you to worry about :)

It's apparently due to the 'link' rule from testing.jam not
passing the libraries to the linker. It works fine if I change
it to use the 'run' rule instead.

The problem only shows up now because the system library is the
first non-header-file-only library used in those particular unit
tests.

>> - error_code::new_category probably needs to be made
>> thread-safe, or the limitations on when it can be called
>> should be documented.
>
> Do we have a portable way to make it thread safe?

Since we want to avoid the nasty problems that come from the
order of initialisation of globals across translation units, the
best I can think of is:

- On POSIX, use a static pthread_mutex_t initialised with
  PTHREAD_MUTEX_INITIALIZER.

- On Windows, use a named mutex (with the name derived from the
  process ID) or a handcrafted spinlock using a static long
  variable.

Cheers,
Chris


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