Question: what should i do for the last todo's here : } / / / / / / / / / / / / / /
what should i do for the last todo's here :
TODO:: let detached threads know they need to shut down using the flag you
created in the thread structure. You may only set the flag once here you should
not have more than one flag and it must be in a thread safe manner.
TODO:: Wait for all detached threads to finish without using a busywait loop.
You must wait for the number of threads to change before checking again to avoid
wasting CPU cycles.
HINT: Remember there is a specific object that can Wait for a Condition
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
