Actions
| Post | |
| Subscribe | |
| Unsubscribe |
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Does the cancelation exception have a name?
- To: c++-pthreads@xxxxxxxxxxxxxxxx
- Subject: Re: Does the cancelation exception have a name?
- From: Alexander Terekhov <terekhov@xxxxxx>
- Date: Sat, 04 Nov 2006 22:25:50 +0100
#define PTHREAD_CANCELED std::thread_canceled()
struct thread_canceled {
operator void * () { return &unique; }
static thread_canceled unique;
};
extern "C" void pthread_exit(void * ptr)
throw(std::thread_termination_request) {
ptr == PTHREAD_CANCELED ? std::thread_cancel() :
std::thread_exit(ptr);
}
template<typename T>
void thread_exit(T value) {
assert(std::thread_self().can_exit_with<T>());
throw thread_exit_value(value);
}
template<>
void thread_exit(std::thread_canceled) {
thread_cancel();
}
void thread_cancel() {
throw std::thread_cancel_request();
}
regards,
alexender.
- References:
- Does the cancelation exception have a name?
- From: Peter Dimov
- Re: [c++-pthreads] Does the cancelation exception have a name?
- From: Daniel Jacobowitz
- Re: [c++-pthreads] Does the cancelation exception have a name?
- From: Peter Dimov
- Re: Does the cancelation exception have a name?
- From: Alexander Terekhov
- Does the cancelation exception have a name?
- Prev by Date: Re: Does the cancelation exception have a name?
- Next by Date: Re: [c++-pthreads] Re: Does the cancelation exception have a name?
- Previous by thread: Re: Does the cancelation exception have a name?
- Next by thread: Re: [c++-pthreads] Re: Does the cancelation exception have a name?
- Index(es):