-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
thread.stop problem #14
Comments
@levBagryansky It's not possible in Java to stop a thread if execution code is not written for that. |
@yegor256 please have a look |
@levBagryansky in Java there is not way to stop a thread unless the thread politely reacts to our signal. Read this, btw: https://www.yegor256.com/2015/10/20/interrupted-exception.html So, I think, "do our best" and send the interrupted signal. If the thread stops -- great. If not, we can't do anything. |
@yegor256 The problem is how we can handle interruption in thread
|
@levBagryansky did you read this: https://www.yegor256.com/2015/10/20/interrupted-exception.html This part:
|
@yegor256 We need to handle InterruptedExeption in |
@levBagryansky the puzzle #24 is still not solved. |
@levBagryansky 2 puzzles #24, #45 are still not solved. |
@levBagryansky all 2 puzzles are solved here: #24, #45. |
It seems I cannot yet implement
thread.stop
.This is implementation of
run
inDataizingThread.java
:And stop in its dataization will do
So in
DataizingThread.java
it must beBut compiler does not allow do that because
Exception 'java.lang.InterruptedException' is never thrown in the corresponding try block
So
Dataized.get
does not throw it. But Thread.sleep that is used in EOsleep.java can do.@yegor256 @mximp may be we have other ways to stop the thread? I see only bad variants like deprecated
Thread.stop
and may be JNI. Or we need to mark some nethods in eothrows InterruptedException
?The text was updated successfully, but these errors were encountered: