惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
J
Java Code Geeks
月光博客
月光博客
博客园_首页
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
B
Blog RSS Feed
博客园 - 聂微东
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
Jina AI
Jina AI
S
SegmentFault 最新的问题
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
The Cloudflare Blog
量子位
Martin Fowler
Martin Fowler
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗

博客园 - sinxsoft

loss.py:result type Float can't be cast to the desired output type long int AttributeError: module 'numpy' has no attribute 'int'. 非root账号,要写入特定文件夹的处理措施 Docker 运行你的Springboot应用。 阿里巴巴中间件团队出品的开源软件以及商业云服务(转) storm 配置,呵呵。 dubbo+zookeeper集群配置 zookeeper分布式部署-mac先测试 tomcat8和7关于自定义tag的处理区别 每个程序员都必读的10篇文章 eclipse 引用项目(转) 债券发行价格招标和收益率招标:需要搞定 IIS之应用程序池-Web园-最大工作进程>1时系统出现问题 研究jBPM和NetBPM 研究:Microsoft Solution Framework SCRUM迭代增量式软件开发过程研究 多说多做多想。 架构师培训笔记: 从今天开始,向注册会计师进军。
Java 之ThreadLocal 对应C#之ThreadStatic
sinxsoft · 2014-09-11 · via 博客园 - sinxsoft

java:


public
class JForumExecutionContext { private static ThreadLocal userData = new ThreadLocal(); /** * Gets the execution context. * @return JForumExecutionContext */ public static JForumExecutionContext get() { JForumExecutionContext ex = (JForumExecutionContext)userData.get(); if (ex == null) { ex = new JForumExecutionContext(); userData.set(ex); } return ex; } /** * Checks if there is an execution context already set * @return <code>true</code> if there is an execution context * @see #get() */ public static boolean exists() { return (userData.get() != null); } }

 C#:  

[ThreadStatic]
private static Object StaticObject = new Object();