# Graceful quit SDL thread which is blocked in I/O in androi

**URL:** <https://discourse.libsdl.org/t/graceful-quit-sdl-thread-which-is-blocked-in-i-o-in-androi/20516>\
**Category:** SDL Development\
**Created:** [March 18, 2014, 5:57am UTC](https://discourse.libsdl.org/t/graceful-quit-sdl-thread-which-is-blocked-in-i-o-in-androi/20516 "2014-03-18T05:57:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![keestu](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/k/839c29/32.png) [@keestu](https://discourse.libsdl.org/u/keestu)\
**Post date:** [March 18, 2014, 5:57am UTC](https://discourse.libsdl.org/t/graceful-quit-sdl-thread-which-is-blocked-in-i-o-in-androi/20516/1 "2014-03-18T05:57:06Z")

</div>

1. Android does not support Thread cancellation, hence i can not use thread cancellation.

Are there any quirk that i need to be aware of?.. The finest goal is to throw a thread out of the system gracefully in SDL.

Any light that can be shown on it ?

As Additional Information:

> From Migration Notes of SDL 2

[https://wiki.libsdl.org/MigrationGuide#Threads](https://wiki.libsdl.org/MigrationGuide#Threads)

" SDL\_KillThread() is gone. It was never safe or reliable. The best replacement is to set a flag that tells a thread it should quit. That thread should check the flag with some frequency, and then the “killing” thread calls SDL\_WaitThread() to clean up. "
