问题描述
我看到上面的注释在JCIP的书中被广泛使用。我认为它是非常有用的,因为即使没有适当的文档,它说了一些关于同步策略的事情。我还看到使用这些注释它们现在实际上是Java语言的一部分本身?
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 ?
推荐答案
这些是不是标准JDK的一部分的自定义注释。要在代码中使用它们,您需要添加依赖关系。
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.
在,则会在页面底部的并发注释:jar,javadoc,源链接到该库及其源代码。
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".
直接链接:
- jar
- javadoc
- source
这篇关于@GuardedBy,@ThreadSafe,@ NotThreadSafe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!