如何标记一个类是线程安全的(或没有)? [英] How to tag that a class is thread-safe (or not)?

查看:155
本文介绍了如何标记一个类是线程安全的(或没有)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MSDN文档中,我们看到:

In MSDN documentation we see :

控制台

线程安全

此类型是线程安全的。

的TextWriter

线程安全

任何公共static
  的(共享在Visual Basic中)的成员
  这种类型是线程安全的。任何
  实例成员都不能保证
  线程安全的。

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

我已经开发了类似的(静态)类到控制台,所以我怎么可以标记它线程安全的?我提取XML文档,我也知道我可以这部分像在MSDN文档。

I've developed a similar (static) class to the Console one, so how can I tag it to thread safe? I'm extracting XML documentation and I would know how I can this part like in the MSDN Doc'.

希望我不够清楚......

Hope I'm clear enough...

感谢您的帮助!

推荐答案

这个细节添加到 <总结> <讲话方式> 标记

Add this detail to the <summary> or <remarks> tags.

有没有关于如何指示类特定的标签或公约是线程安全的 - 你需要将它写入您的文档中

There is no specific tag or convention on how to indicate a class is thread safe - you need to write it in your documentation.

这篇关于如何标记一个类是线程安全的(或没有)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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