[omniORB] pthreads for solaris, linux ... mach?

ERIKSSON,TOBIAS (A-Sweden,ex1) tobias_eriksson@agilent.com
Fri, 17 Nov 2000 16:42:09 +0100


Thanx Gary,
 Although, there is something strange, if I put a try{ }catch(...){}
around my delete of the mutex, it does not pick up the exception.
e.g.

try
{
	if( myMutex )
	{
		delete myMutex;
		myMutex=NULL;
	}
}
catch(...)
{
	cerr << "Woops! and exception." << endl;
}

I never get this far, the application ends with stacktrace below anyway.
How can this be?

Regards
 Tobias


-----Original Message-----
From: Gary D. Duzan [mailto:gdd0@gte.com]
Sent: den 17 november 2000 16:27
To: ERIKSSON,TOBIAS (A-Sweden,ex1)
Cc: omniorb-list@uk.research.att.com
Subject: Re: [omniORB] pthreads for solaris, linux ... mach? 


   If you look at the source for posix.cc again, you'll see that
THROW_ERRORS() is a macro which checks the return value of its
argument and throws an exception if it returned an error.

					Gary Duzan
					Verizon Laboratories



In Message <4B68A8D2B880D311BCB70090278CBF621F7CCC@cordelia> ,
   "ERIKSSON,TOBIAS (A-Sweden,ex1)" <tobias_eriksson@agilent.com> wrote:

=>Hi
=> I had an error in my application and started to go through the
stacktrace,
=>it came down to a method called ~omni_mutex(), I tried to look it up and
=>found out that there were a couple of files to choose from containing the
=>destructor ~omni_mutex(). There are :
=>	mach.cc
=>	nt.cc
=>	posix.cc
=>	solaris.cc
=>I guess that Linux (debian or Redhat) uses the posix.cc, is that correct?
=>
=>If I look in that one there is only one line, and it says something like
=>this:
=>	THROW_ERRORS(pthread_mutex_destroy(...
=>
=>This method exists in /usr/include/pthread.h, but is as I understand a
C-lib
=>method.
=>In my stacktrace, below, that method pthread_mutex_destroy() is not in the
=>stacktrace, and if is but isn't shown then it throws an exception, how is
=>that possible from a C-lib?
=>And how can a mutex raise an exception?
=>
=>#0  0x401a3931 in kill () from /lib/libc.so.6
=>#1  0x40020ee9 in pthread_kill () from /lib/libpthread.so.0
=>#2  0x40021365 in raise () from /lib/libpthread.so.0
=>#3  0x401a4d28 in abort () from /lib/libc.so.6
=>#4  0x40146f58 in __terminate () from /usr/lib/libstdc++-libc6.1-2.so.3
=>#5  0x40146f75 in __terminate () from /usr/lib/libstdc++-libc6.1-2.so.3
=>#6  0x40147af4 in __throw () from /usr/lib/libstdc++-libc6.1-2.so.3
=>#7  0x4011f151 in omni_mutex::~omni_mutex ()
=>.
=>.
=>.
=>
=>I don't understand how this works, could someone help me out. 
=>
=>Regards 
=> Tobias
=>
=>