[omniORB] orb->shutdown() in a signal handler

Duncan Grisby duncan@grisby.org
Tue Jul 16 11:59:01 2002


On Monday 15 July, Favre Benoit wrote:

> Is there a special issue for using orb->shutdown() in a signal handler ?

Yes -- don't do it!

All sorts of things can go wrong if you try it. None of the usual
thread synchronisation things are guaranteed to work. Sometimes they
will, sometimes they'll blow up.

The correct solution is to have a thread waiting on a POSIX
semaphore. sem_post() is the only threading primitive that is signal
safe.

Cheers,

Duncan.

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