An invention is provided for a synchronous transfer of control. An
asynchronous interrupt exception is received, and in response, the value
of a reference counter is determined. The value of the reference counter
is based on the execution of synchronized code. Generally, the reference
counter is initialized to a predetermined number, and altered based on
the execution of synchronized code. When the asynchronous interrupt
exception is received, the method is asynchronously interrupted when the
value of the reference counter is equal to the predetermined number.