Boost logo

Threads-Devel :

Subject: Re: [Threads-devel] catching thread_interrupted
From: Anthony Williams (anthony_at_[hidden])
Date: 2010-02-04 03:02:33


On 03/02/10 23:13, Scott Bailey wrote:
> Here is the setup:
>
> MyCommon.so
> - this lib contains some basic classes, one of which (baseTRx) has a
> boost::thread.
> - this lib includes boost_system and boost_thread using the
> --whole-archive flag (linux) and equivalent for darwin and win
> - this was done to minimize the number of files the customer would
> receive, among other reasons...
> MyTRx.so
> - this lib contains a class derived from baseTRx (myTRx).
> - links to MyCommon
> MyEXE
> - this contains main.
> - links to MyCommon
> - loads MyTRx at run time.
> - creates an instance od myTRx.
> - signals MyEXE (via interupt()) when its time to cleanly shut down
>
> Using GCC 4.2 w/ -fvisibility=hidden, thread_interrupted isn't being
> caught in myTRx since it's being thrown from a different so w/ hidden
> visibility.

OK, makes sense.

> The fix for this is:
> #define BOOST_THREAD_DECL __attribute__ ((visibility("default")))
> when gcc has visibility.
>
>
> Am I correct? If so, I'll write the defect and work on the patch....

If that works, write it up and I'll patch boost.thread

Anthony

-- 
Author of C++ Concurrency in Action     http://www.stdthread.co.uk/book/
just::thread C++0x thread library             http://www.stdthread.co.uk
Just Software Solutions Ltd       http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk