[IronPython] thread.interrupt_main() not implemented

Curt Hagenlocher curt at hagenlocher.org
Fri Oct 19 19:16:34 CEST 2007


thread.interrupt_main has somewhat different semantics than Thread.Abort; it
basically triggers a keyboard interrupt on the main thread -- this is, of
course, an exception that can be caught and handled by user code on that
thread.

On 10/19/07, Dino Viehland <dinov at exchange.microsoft.com> wrote:

>  I think you could work around this by remembering the main .NET thread
> and calling Abort on it:
>
>
>
> from System import Threading
>
> main = Thread.CurrentThread
>
>
>
> # and then later on…
>
>
>
> main.Abort()
>
>
>
> But I'd suggest that interrupting a thread at an arbitrary point is a
> little dangerous (as it may have some state which isn't entirely consistent
> that it's trying to update).
>
>
>
>
>
> *From:* users-bounces at lists.ironpython.com [mailto:
> users-bounces at lists.ironpython.com] *On Behalf Of *Clems no
> *Sent:* Friday, October 19, 2007 8:37 AM
> *To:* users at lists.ironpython.com
> *Subject:* [IronPython] thread.interrupt_main() not implemented
>
>
>
> Hello,
>
> When i want to use thread.interrupt_main() in iron python script, i've got
> this error:
>    NotImplementedError: interrupt_main not implemented
>
> Is there an equivalent in ironpython?
>
> Thanks,
>
> cbr.
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20071019/98cf5ab9/attachment.html>


More information about the Ironpython-users mailing list