This is the mail archive of the pthreads-win32@sources.redhat.com mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: catch (...)


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
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]