Not. In general, you cannot safely terminate a thread "immediately" because it could be a resource leak, and, more importantly, it might contain locks. You need to structure your employee to comply with the cancellation flag and exit safely as soon as possible.
source share