How to control a while loop iteration in a class from a while loop outside it
问题 I am trying to read frames of a video leveraging a multithreading class. So, there is a while loop inside the class, which keeps reading the video. And there is a while loop in the main, which accesses the frames from the variables of that class, but what I found is, the outer while has no control over the inner while. It is just grabbing the current running frame from the inner while. To experiment, I put a sleep and saw the loss of frames. I do not want that, I want the outer loop to get