https://github.com/idelvall/kill-test
Simple java test for handling kill unix signals and interrupting threads
https://github.com/idelvall/kill-test
Last synced: 10 months ago
JSON representation
Simple java test for handling kill unix signals and interrupting threads
- Host: GitHub
- URL: https://github.com/idelvall/kill-test
- Owner: idelvall
- Created: 2015-11-18T11:24:22.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-18T11:36:29.000Z (over 10 years ago)
- Last Synced: 2025-04-08T15:52:33.743Z (about 1 year ago)
- Language: Java
- Size: 1.95 KB
- Stars: 7
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kill-test
A test about dealing with UNIX kill signals and interrupting threads
Running:
```
java -jar kill-test-1.0.0-SNAPSHOT.jar
```
Ctrl+C:
```
Running 'non-blocking'
Running 'blocking'
^CInterrupting threads
Interrupting 'class org.brutusin.kill.KillTest$2' termination
Interrupting 'class org.brutusin.kill.KillTest$3' termination
Waiting 'non-blocking' termination
Thread 'blocking' interrupted
Checking interrupted
Thread 'non-blocking' interrupted
Shutdown finished
```
[StackOverFlow](http://stackoverflow.com/questions/2541597/how-to-gracefully-handle-the-sigkill-signal-in-java/33778483#33778483)