Claims
- 1. A process for providing asynchronous transfer of control, comprising the operations of:
receiving an asynchronous interrupt exception (AIE); determining whether a method is currently executing synchronized code based on particular method calls; and asynchronously interrupting the method when the method is executing non-synchronized code.
- 2. A process as recited in claim 1, wherein the particular method calls are monitor calls.
- 3. A process as recited in claim 2, wherein the monitor calls include a monitor enter method call, the monitor enter method call allowing a related thread to enter a monitor.
- 4. A process as recited in claim 3, wherein the monitor calls include a monitor exit method call, the monitor exit method call allowing the related thread to exit the monitor.
- 5. A process as recited in claim 4, wherein code executed after the monitor enter call and before the monitor exit call is synchronized code.
- 6. A process as recited in claim 5, further comprising the operation of allowing synchronized code to complete execution before asynchronously interrupting the method when synchronized code is being executed.
- 7. A process as recited in claim 1, further comprising the operation of determining whether the method allows asynchronous interrupts.
- 8. A process as recited in claim 7, further comprising the operation of delaying asynchronous interruption until the method completes execution when the method does not allow asynchronous interrupts.
- 9. A process as recited in claim 8, further comprising the operation of delaying asynchronous interruption until the method invokes a second method that allows asynchronous interrupts, when the method does not allow asynchronous interrupts.
- 10. A method for providing asynchronous transfer of control, comprising the operations of:
receiving an asynchronous interrupt exception (AIE); determining a value of a reference counter, the reference counter value based on execution of synchronized code; and asynchronously interrupting the method when the value of the reference counter is a predetermined number.
- 11. A method as recited in claim 10, wherein the reference counter is based on monitor calls.
- 12. A method as recited in claim 11, wherein the monitor calls include a monitor enter method call, the monitor enter method call allowing a related thread to enter a monitor.
- 13. A method as recited in claim 12, further comprising the operation of incrementing the reference counter when a monitor enter method call is performed.
- 14. A method as recited in claim 13, wherein the monitor calls include a monitor exit method call, the monitor exit method call allowing the related thread to exit the monitor.
- 15. A method as recited in claim 14, further comprising the operation decrementing the reference counter when a monitor exit method call is performed.
- 16. A method as recited in claim 15, wherein code executed after the monitor enter call and before the monitor exit call is synchronized code.
- 17. A method as recited in claim 16, further comprising the operation of initializing the reference counter to the predetermined number, whereby the method is executing synchronized code when the reference counter is unequal to the predetermined number.
- 18. A computer program embodied on a computer readable medium, the computer program capable of providing asynchronous transfer of control, comprising:
a code segment for receiving an asynchronous interrupt exception (AIE); a code segment for altering a value of a reference counter based on monitor method calls; a code segment for determining the value of the reference counter; and a code segment for asynchronously interrupting the method when the value of the reference counter is a predetermined number.
- 19. A computer program as recited in claim 18, wherein the monitor method calls include a monitor enter method call that allows a related thread to enter a monitor, and wherein the reference counter is incremented when a monitor enter method call is performed.
- 20. A computer program as recited in claim 19, wherein the monitor method calls include a monitor exit method call that allows the related thread to exit the monitor, and wherein the reference counter is decremented when a monitor exit method call is performed.
- 21. A computer program as recited in claim 20, further a code segment that initializes the reference counter to the predetermined number, whereby the method is executing synchronized code when the reference counter is unequal to the predetermined number.
CROSS REFERENCE TO RELATED APPLICATIONS
[0001] This application claims the benefit of U.S. Provisional Patent Application No. 60/348,105, Oct. 23, 2001, entitled “System and Method for Asynchronous Transfer of Control,” which is incorporated herein by reference.
Provisional Applications (1)
|
Number |
Date |
Country |
|
60348105 |
Oct 2001 |
US |