Android Guides | Samples

Java.Lang.Thread.Interrupt Method

Posts an interrupt request to this Thread.

Syntax

[Android.Runtime.Register("interrupt", "()V", "GetInterruptHandler")]
public virtual Void Interrupt ()

See Also

Remarks

Posts an interrupt request to this Thread. The behavior depends on the state of this Thread:

  • Threads blocked in one of Object's wait() methods or one of Thread's join() or sleep() methods will be woken up, their interrupt status will be cleared, and they receive an InterruptedException.
  • Threads blocked in an I/O operation of an IInterruptibleChannel will have their interrupt status set and receive an ClosedByInterruptException. Also, the channel will be closed.
  • Threads blocked in a Selector will have their interrupt status set and return immediately. They don't receive an exception in this case.

    [Android Documentation]

    Requirements

    Namespace: Java.Lang
    Assembly: Mono.Android (in Mono.Android.dll)
    Assembly Versions: 0.0.0.0
    Since: Added in API level 1