[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] thread cancellation via C++ exception



Good day,

Just in case somebody would be interested:

This patch alters nptl to use C++ exception for thread cancellation.

When HAVE_FORCED_UNWIND is defined nptl uses forced unwinding of exception
handling mechanism (should we call it ABI exception handling?) to unwind
the stack and call cleanup handlers. This allows catching cancellation
exception with C++ catch(...) handler.

This patch makes nptl throw a C++ exception (std::thread_canceled, defined
in pthread.h) during thread cancellation. As a result you can use typed
handler to identify this situation:

  try
  {
 
    // ...  
 
  }
  catch (std::thread_caceled const&)
  {
    // ...
    throw;
  }

The patch is against cvs-2004-05-07 and is available from

ftp://kolpackov.net/pub/projects/glibc/ 

comments are welcome,
-boris

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]