@GuardedBy 、 @ThreadSafe 、@NotThreadSafe [英] @GuardedBy , @ThreadSafe ,@NotThreadSafe

查看:42
本文介绍了@GuardedBy 、 @ThreadSafe 、@NotThreadSafe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到 JCIP 一书中广泛使用了上述注释.我认为它真的很有用,因为即使没有适当的文档,它也说明了一些关于同步策略的内容.我还看到 Intellij Idea 使用了这些注释 他们现在实际上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.

jcip.net 上,页面底部有一个指向图书馆及其来源的链接并发注解:jar、javadoc、source".

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".

直接链接:

这篇关于@GuardedBy 、 @ThreadSafe 、@NotThreadSafe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆