Attenton 最近的时间轴更新
Attenton

Attenton

V2EX 第 216475 号会员,加入于 2017-02-21 17:00:14 +08:00
根据 Attenton 的设置,主题列表被隐藏
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
Attenton 最近回复了
227 天前
回复了 Attenton 创建的主题 C++ c++的单线程 mutex 问题
@geelaw 感谢
227 天前
回复了 Attenton 创建的主题 C++ c++的单线程 mutex 问题
@geelaw 感谢,这个标准的定义可以在哪看?
227 天前
回复了 Attenton 创建的主题 C++ c++的单线程 mutex 问题
@ysc3839 嗯嗯,我也找到了,感谢
227 天前
回复了 Attenton 创建的主题 C++ c++的单线程 mutex 问题
If lock is called by a thread that already owns the mutex, the behavior is undefined: for example, the program may deadlock. An implementation that can detect the invalid usage is encouraged to throw a std::system_error with error condition resource_deadlock_would_occur instead of deadlocking.

If the mutex is currently locked by the same thread calling this function, it produces a deadlock (with undefined behavior).

是个 undefined behavior ,不能这样使用,结贴😓


Reference:
https://en.cppreference.com/w/cpp/thread/mutex/lock
https://cplusplus.com/reference/mutex/mutex/lock/
227 天前
回复了 Attenton 创建的主题 C++ c++的单线程 mutex 问题
@iwdmb
(base) root@ubuntu:/home# ./a.out
n = 5
n = 4
n = 3
n = 2
n = 1
n = 0
(base) root@ubuntu:/home# g++ --version
g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

以上是我的执行结果,没搞懂是哪的问题
227 天前
回复了 Attenton 创建的主题 C++ c++的单线程 mutex 问题
补充:CmakeLists.txt 里面没有添加任何编译选项,cmake 版本是 3.18 , 用的 c++ 17
2021-02-02 17:46:12 +08:00
回复了 geektony 创建的主题 分享发现 对于 Clubhouse 这种基于声音社交形式,大家怎么看?
感觉和 YY 没啥区别啊。。
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3270 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 14:07 · PVG 22:07 · LAX 07:07 · JFK 10:07
Developed with CodeLauncher
♥ Do have faith in what you're doing.