From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Lorin Hochstein" To: Subject: Re: cancelling Date: Wed, 12 Jul 2000 08:44:00 -0000 Message-id: <00e901bfec18$1c2c9fc0$0701a8c0@xiphos.ca> References: <430F887D415DD1118C2700805F31ECF1037F1263@sota0005.cognos.com> X-SW-Source: 2000/msg00033.html See the documentation on the "_set_se_translator" function for translating to SEH to C++ exceptions. Lorin Hochstein ----- Original Message ----- From: "Bossom, John" To: "'Thomas Sailer'" ; "Bossom, John" Cc: Sent: Wednesday, July 12, 2000 10:33 AM Subject: RE: cancelling > Now, originally I implemented the pthread_cancel mechanism > with Microsoft's SEH (Structured Exception Handling) > and internally the BAD DEED is being thrown using this > mechanism and being caught by the thread start routine. > > You should check to see if someone changed the thread > start routine to use the C++ exception mechanism. > > The drawback of SEH is that it doesn't work well > with C++ as it bypasses the C++ stack unwinding > (i.e. calling destructors). > > This could be handled by using a hook function that > maps SEH into C++ exceptions and using C++ exception > handling in your mainline for your thread. You'll > have to do some reading on providing the hook in > the Microsoft documentation. (I haven't done this > but it seems like a good theory anyway ;^) > > John. > > -----Original Message----- > From: Thomas Sailer [ mailto:sailer@ife.ee.ethz.ch ] > Sent: Wednesday, July 12, 2000 7:21 AM > To: Bossom, John > Cc: pthreads-win32@sourceware.cygnus.com > Subject: Re: cancelling > > > "Bossom, John" wrote: > > > Check to see if the code base for pthread is wrapping > > an exception handler around your thread mainline > > (the original code had an internal routine called "threadStart" > > which used Microsoft's Structured Exception Handling for catching all > > exceptions raised in your thread.) > > The thread I'm trying to cancel was created with pthread_create, > and internally the thread routine is started through > _pthread_threadStart, which should be fine. > > The thread that tries to cancel is the initial thread, i.e. > the one that called _main. > > > Now, your thread is recognizing the cancel (the exception > > hex value is human readable: BAD DEED) and should have > > I thought that the constant wasn't chosen arbitrarily :)) > > Tom