public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: Ross Johnson <rpj@ise.canberra.edu.au>
To: pthreads-win32@sourceware.cygnus.com
Subject: Re: catch (...)
Date: Mon, 06 Aug 2001 20:38:00 -0000	[thread overview]
Message-ID: <3B6F6298.F2C8055D@ise.canberra.edu.au> (raw)
In-Reply-To: <00ae01c11e36$c4c02ac0$3c194442@acme>

Just to add to Scott's response, there is also a version of the
dll that uses setjmp/longjmp rather than exceptions (thanks
to Thomas Pfaff). It's named pthreadVC.dll, but it doesn't do
any cleanup apart from that done by pthreads cleanup handlers.

Ross

Scott McCaskill wrote:
> 
> pthreads-win32 uses exceptions to implement thread cancellation.  This means
> that, in the threads that you create, if your code (or any code you call)
> uses catch(...), it may inadvertantly circumvent this thread cancellation
> mechanism.  This is why there is a warning telling you to use PtW32CatchAll
> in place of catch(...).
> 
> If you look at the bottom of pthread.h, you will see that PtW32CatchAll is
> defined as follows:
> 
> #define PtW32CatchAll \
>         catch( ptw32_exception & ) { throw; } \
>         catch( ... )
> 
> ----- Original Message -----
> From: "Ye Liu" <yliu@tibco.com>
> To: <pthreads-win32@sourceware.cygnus.com>
> Sent: Sunday, August 05, 2001 11:28 PM
> Subject: catch (...)
> 
> > Greets,
> >
> > I have a question on using pthread-win32 in C++:
> >
> > When I compiling my code with try and catch, I got
> >
> > "When compiling applications with MSVC++ and C++ exception handling:
> >   Replace any 'catch( ... )' with 'PtW32CatchAll' in POSIX threads
> >   if you want POSIX thread cancelation and pthread_exit to work."
> >
> > in compiling.
> >
> > May I know what PtW32CatchAll is ? A catch comply certain standard from
> > Microsoft? I cannot find any information in MSDN. Can someone give me some
> > details for it?
> >
> > Regards,
> >
> > --ye
> >
> >

  parent reply	other threads:[~2001-08-06 20:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-31 14:31 critical section Ye Liu
2001-07-31 15:22 ` Scott McCaskill
2001-07-31 15:39   ` Ye Liu
2001-07-31 15:52     ` Scott McCaskill
2001-08-05 21:31       ` catch (...) Ye Liu
2001-08-05 22:07         ` Scott McCaskill
2001-08-05 22:12           ` Ye Liu
2001-08-06 20:38           ` Ross Johnson [this message]
2001-08-07  8:49             ` reentrant
2001-08-07 20:52               ` Ross Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3B6F6298.F2C8055D@ise.canberra.edu.au \
    --to=rpj@ise.canberra.edu.au \
    --cc=pthreads-win32@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).