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

推荐订阅源

Google DeepMind News
Google DeepMind News
G
Google Developers Blog
博客园 - 三生石上(FineUI控件)
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
V
V2EX
Vercel News
Vercel News
U
Unit 42
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
J
Java Code Geeks
WordPress大学
WordPress大学
罗磊的独立博客
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
M
MIT News - Artificial intelligence
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Apple Machine Learning Research
Apple Machine Learning Research
Martin Fowler
Martin Fowler
云风的 BLOG
云风的 BLOG

博客园 - 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();