On Sun, Dec 2, 2012 at 10:53 PM, David Mertens <dcmertens.p...@gmail.com>wrote:
> ----%<---- > > defined (threads->object($originating_tid{$name})) > or croak("retrieve_pdls: '$name' was created in a thread that " > . "is no longer available"); > > ---->%---- > > In my test suite, I create and store data in the main thread. For this > example, then, $originating_tid{$name} == 0 for all cases considered. The > problem is that only the main thread is capable of retrieving the threads > object for tid 0. Any other (child) thread gets an undefined value. Does > that surprise anyone? Are child threads able to get the thread objects for > their parents or siblings? > I might be misreading this, but I believe that threads->object() ignores detached threads unless a tid is explicitly passed in *and* that tid is the tid of the calling thread. The main thread is detached, so no thread other than tid 0 can look it up via object(). (You describe an interesting problem and approach; do you have demonstration code that others can take a look at?) -Mike