归档:2023年8月
-
localtime在多线程中的问题
2023-08-01 碰到一个奇怪的问题,通过localtime生成本地日期时间打日志,结果日志会出现非北京时间,好奇去查了一个,结果发现此函数是非线程安全函数,原来代码如下: int32_t utc2datetime(uint32_t utctime, SVC_TIME* out_pTime) { time_t rawtime; struct tm * p; rawtime = utctime; p = localtime(&rawtime); out_pTime->unYear = (uint32_t)(1900 + p->tm_year); out_pTime->u...
小A
偷得浮生半日闲
想闲又闲不下来的打工人,想成为富二代成为了负二代
热门文章
- 1 Typecho仿百度响应式主题Xaink
- 2 腾讯云羊毛衫
- 3 给Jasmine主题加网站rss链接
- 4 给Jasmine主题加上下拉菜单
- 5 准备给blog更换个域名
- 6 清明罗浮山小记
- 7 Elasticsearch介绍
- 8 Typecho彩蛋插件Konami
- 9 免费域名整理
- 10 簕杜鹃