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?

有帮助吗?

解决方案

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

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top