|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=METHOD) public @interface Interruptible
By default all Java code is interruptible, that is scheduling or garbage
collection may occur at points within the code. Code can be marked as
Unpreemptible
or Uninterruptible
, that instructs the JVM to
avoid garbage collection and thread scheduling. The Uninterruptible
annotation disallows any operation that may cause garbage collection or
thread scheduling, for example memory allocation. The Unpreemptible
annotation doesn't disallow operations that can cause garbage collection or
scheduling, but instructs the JVM to avoid inserting such operations during a
block of code.
In the internals of a VM most code wants to be Uninterruptible
.
However, code involved in scheduling and locking will cause context switches,
and creating exception objects may trigger garbage collection, this code is
therefore Unpreemptible
.
This pragma is used to declare that a particular method is interruptible. It
is used to override the class-wide pragma Uninterruptible
.
Optional Element Summary | |
---|---|
String |
value
|
public abstract String value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |