|
Boost : |
From: terekhov (terekhov_at_[hidden])
Date: 2002-01-24 06:22:24
--- In boost_at_y..., "davlet_panech" <davlet_panech_at_y...> wrote:
[...]
> try {
> while( true ) {
> // do something
> }
> catch( thread_cancel & ) {
> // do some other thing
> }
Do you *really* want to have something along the lines
of Java's "interrupted()/The interrupted status of the
thread is cleared by this method/isInterrupted()/The
interrupted status of the thread is unaffected by this
method" which would allow you to eat "interrupt/cancel"
exceptions***?! How about thread exit()??
regards,
alexander.
------
[***] interrupt public void interrupt()
Interrupts this thread.
First the checkAccess method of this thread is invoked, which may
cause a SecurityException to be thrown.
If this thread is blocked in an invocation of the wait(), wait(long),
or wait(long, int) methods of the Object class, or of the join(), join
(long), join(long, int), sleep(long), or sleep(long, int), methods of
this class, then its interrupt status will be cleared and it will
receive an InterruptedException.
If this thread is blocked in an I/O operation upon an interruptible
channel then the channel will be closed, the thread's interrupt
status will be set, and the thread will receive a
ClosedByInterruptException.
If this thread is blocked in a Selector then the thread's interrupt
status will be set and it will return immediately from the selection
operation, possibly with a non-zero value, just as if the selector's
wakeup method were invoked.
If none of the previous conditions hold then this thread's interrupt
status will be set.
-------
Well, feel free call me an *idiot*, but I do *NOT* comprehend the
usefulness of Java's "interrupt" model with respect to much
simpler and robust PTHREAD's cancel and exit "always-rethrow-
exceptions".
regards,
alexander.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk