[omniORB] Accessing methods after join?

Mark Johnson mark.johnson@onfiber.com
Wed, 19 Sep 2001 10:45:00 -0500


If I derive from omni_thread can I access my thread class's methods after a
join has returned? Also, do I need to delete the object after a join?

example:

  MyThread * thread = new MyThread; // starts undetached
  thread->join( (void**)&rv );
  std::cout << thread->getName() << " has finished. " << std::endl;  //
don't think this will work
  delete thread; // ??
	
In the examples directory the following example was given:

int main(int argc, char** argv)
{
    thread_with_data* t = new thread_with_data;

    cerr << "main: joining\n";

    int* rv;
    t->join((void**)&rv);

    cerr << "main: joined - got return value " << *rv << endl;

    delete rv;

    return 0;
}

But I'm confused as to why they bothered deleting 'rv' and not 't' too?