[omniORB] Omni 4.0.6 and Purify

Duncan Grisby duncan at grisby.org
Fri Jan 6 14:30:51 GMT 2006


On Wednesday 4 January, Regis DETRE wrote:

> The comment in omnithread.h saids :
> 
> #ifndef __rtems__
> static omni_thread::init_t omni_thread_init;
> #else
> // RTEMS calls global Ctor/Dtor in a context that is not
> // a posix thread. Calls to functions to pthread_self() in
> // that context returns NULL. 
> // So, for RTEMS we will make the thread initialization at the
> // beginning of the Init task that has a posix context.
> #endif
> 
> The explanation for RTEMS looks good for Solaris in my case.  We are 
> continuing to investigate.

But on Solaris you don't have an "Init task". RTEMS is an embedded
platform, so its behaviour is rather different from other platforms.

It's crucial that omnithread is initialised before anything that uses
it. For your testing, you can comment out the static omni_thread_init in
omnithread.h, but you _must_ create an instance of the init_t class
somewhere (e.g. in main()) before you use anything to do with
omnithread. That's not safe in general, so omnithread can't be changed
for everyone, but it should work for you.

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list