@GuardedBy , @ThreadSafe ,@NotThreadSafe

旧街凉风 提交于 2019-11-27 00:52:25

问题


I see that the above annotations are used extensively in the book JCIP . I think it is really useful because even in the absence of proper documentation it says some things about the synchronization policies . I also see that Intellij Idea makes use of these annotations Are they now actually part of the Java language itself ?


回答1:


These are custom annotations that are not part of the standard JDK. To be able to use them in your code, you need to add a dependency.

At jcip.net, there is a link to the library and its source in the bottom part of the page "Concurrency annotations: jar, javadoc, source".

Direct links:

  • jar
  • javadoc
  • source


来源:https://stackoverflow.com/questions/11362298/guardedby-threadsafe-notthreadsafe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!