Boost logo

Boost :

Subject: Re: [boost] [threads] namespace & externs
From: Anthony Williams (anthony.ajw_at_[hidden])
Date: 2011-01-26 03:35:45

scot shinderman <scot_at_[hidden]> writes:

> In boost/thread/src/pthread/thread.cpp we see extern "C" {}
> around code such as tls_destructor. Is this needed so it
> interfaces w/ native pthread local storage?


> When a vendor program is built against a specific version
> of boost it usually becomes necessary to isolate other users
> via a namespace. However, anything with extern "C"
> style defeats this. Aside from explicit linking to native c
> api's are there reasons for this; also what's considered the best
> style to isolate different versions -- currently we modify every header
> with a version-ed namespace wrapper.

extern "C" is only used where it is necessary (at least, that is the
intent). If you need the extern "C" stuff to be versioned then you'll
have to rename it. Renaming the namespace seems a sensible option for
the rest of the code.


Author of C++ Concurrency in Action
just::thread C++0x thread library   
Just Software Solutions Ltd
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

Boost list run by bdawes at, gregod at, cpdaniel at, john at