Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbstractManage 中的 QMutex 互斥锁是否必要? #47

Closed
vGenGv opened this issue Aug 12, 2021 · 1 comment
Closed

AbstractManage 中的 QMutex 互斥锁是否必要? #47

vGenGv opened this issue Aug 12, 2021 · 1 comment

Comments

@vGenGv
Copy link

vGenGv commented Aug 12, 2021

我发现在 AbstractManage::newSession 中,使用了 QMutex 对 availableSessions_ 进行了保护,但是这种保护是否必要?

  1. 所有的 Session 对象均在同一个线程(serverThreadPool_ 中的唯一一个线程)。
  2. 根据我的测试,Lambda 槽函数调用时是非跨线程的。
  3. 我没有找到其他的跨线程的对 availableSessions_ 的访问。
    所以应当不会有多线程冲突。
    另外,设置 availableSessions_ 的用途是什么?
@188080501
Copy link
Owner

这个是当时调试的时候留下来的代码,现在而言没有实际作用

@vGenGv vGenGv closed this as completed Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants