[omniORB] How to kill an omni_thread ???

Andreas.Koehler koehler@vs.dasa.de
Wed, 4 Nov 1998 14:02:44 +0100 (MET)


Hallo,

using omniORB2 our pthread implementation should be substituted with
omni_threads. One of the implemented functionality creates a pthread,
waits for TIMEOUT seconds and will kill the pthread, if the pthread is
still running after TIMEOUT seconds:

  pthread_t thr;
  pthread_attr_t attr;
  pthread_attr_init (&attr);
  pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
  if (pthread_create (&thr, &attr, <function_ptr>, <arg_ptr>)) {
        perror ("thread creation failed");
        kill (getpid (), SIGTERM); // terminating with implemented handler
  }
  ...
  pthread_kill(thr, SIGINT);

Now we create an omni_thread with:

  omni_thread *thr;
  thr = omni_thread::create(<function_ptr>, <arg_ptr>);

But what's the analogon to pthread_kill? Calling the destructor is not
allowed!

Thanks for your answers!
Andreas