[omniORB] How to deleting an object derived from omni_thread and POA_MyObje ct

Matej Kenda matej.kenda@hermes.si
Mon, 14 Jan 2002 17:13:00 +0100


Hi,

I have a CORBA object that is derived from its POA, my basic CORBA component
and from omni_thread.

class MyObject:  
    public virtual POA_MyObject,
    public virtual MyComponent,
    public virtual omni_thread {

The object starts an initialisation thread when it is created
(run_undetached so that the object is not deleted after the execution
completes). This is done because the object factory may not be blocked by
the object initialisation in new, which can last for quite a long time.

I have problems deactivating/deleting such an object. I can't use join,
because it wants to delete the object, but the POA is not happy about that.
On the other hand, deactivate_object can't be called because ~omni_thread
will complain (pthread's join is not called).

One of the solutions would be to implement a non-destructive join in
omni_thread.

* Has anyone tried something like that?
* Are there any other obvious solutions?

TIA,

Matej