Chapter 9. Closures

Much of the RTSJ involves changing some part of the JVM's state in a controlled way, then being absolutely sure to restore the previous state in an organized way. Method invocation changes several parts of the JVM's state and then restores them on return. Opening curly braces change the name resolution state, and closing braces restore it. The RTSJ needed to add a new mechanism to the Java language so it could control memory allocation and the propagation of asynchronously interrupted exceptions.

We could have extended the language, but on reflection we did not want to stick our heads into that meat grinder. Instead, we used a programing construct, called a closure, ...

Get Real-Time Java™ Platform Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.