Pregunta

I just came across a BNF Grammar for JAVA. In it, "modifier" has a terminal symbol called "threadsafe". However, I have never seen it before and have not been able to locate that modifier in The Java Language Specification, Java SE 7 Edition (docs.oracle.com/javase/specs/jls/se7/jls7.pdf). Yet, I found it here, describing it in bullet 16 as:

If another thread excuting this code at the same time can not change the value of a variable then the variable is threadsafe and the compiler may do clever things with it to make the code faster or smaller.

Is this a real modifier? Is it supposed to be introduced in upcomming versions of JAVA?

¿Fue útil?

Solución

Try to find it here, at the official source of Java BNF.

Otros consejos

No it's not, nor is private_protected in the same list.

Both Java and Groovy have keywords like "threadsafe" and "goto" as "reserved tokens" in the compiler, but they have no meaning right now in the language.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top