Am 20.01.2015 um 23:41 schrieb [email protected]: > Chris Vine: > >> Does anyone know if thread-terminate! can safely be called on a >> thread which is blocking on thread-wait-for-i/o!, without putting >> chicken's internals into an inconsistent state. > > Calling thread-terminate! in any circumstances may put your code > into a bad state, because it unlocks mutexes without letting the > user data structures that those mutexes protect be unwound. > In general, terminating threads from outside is always a Bad Thing.
John is right about the general case. There are however circumstances when you just want to abort some operation. If you know what you do, external abort is sometimes ok. Most of the time however I'd recommend to use thread-signal! to allow the terminated thread receive an exception and abort cleanly. Chicken _itself_ however should not end up in an inconsistent state because of thread-terminate!. _______________________________________________ Chicken-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-users
