[omniORB] coredump when using omni_mutex

Duncan Grisby dgrisby@uk.research.att.com
Fri, 18 May 2001 10:27:48 +0100


On Friday 18 May, "GAO,YAN (HP-Singapore,ex3)" wrote:

>  Int main()
>  {
>    omni_mutex mu;
>    mu.lock();
>    exit(0);
>   }
> 
> Then I would get coredump by receive signal abort()
> 
> It seems that I must call mu.unlock() before I exit in order to prevent the
> happening of coredump.

pthreads complains when you destroy a mutex which is locked.
omnithread throws the omni_thread_fatal exception in response. The
proper way around it is not to exit while holding any locks. Failing
that, just catch the exception.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --