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

Why do we need lock nothing in jthread.cpp #3

Open
cnzf1 opened this issue Jun 12, 2020 · 1 comment
Open

Why do we need lock nothing in jthread.cpp #3

cnzf1 opened this issue Jun 12, 2020 · 1 comment

Comments

@cnzf1
Copy link

cnzf1 commented Jun 12, 2020

At jthread.cpp:131, why do we need add continuemutex2.Lock() and continuemutex2.Unlock(), and has nothing between the two function.

@j0r1
Copy link
Owner

j0r1 commented Jun 12, 2020

The locking is done to make sure that an other thread released the lock. Ultimately this is done do make sure that the start function only exits after you've called ThreadStarted from within your own code

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