Hi,
Fred Kiefer wrote:
This is just a guess but from looking at the code in the CHECK_DONE
macro I would expect that "paused" has exactly the same result as
"stopped", which is to break out of the infinite loop in the -doMove and
that seems wrong to me. I would expect that pause either directly halts
the thread or if you really want to implement this yourself, it should
put the thread to sleep internally until the continue or stop button
gets pressed. Using something like
while (paused) sleep(1);
as the first line in CHECK_DONE.
that could be a way, but I wonder why the current code does not work: it
breaks out of the operation loop when pause or stopped is set.
Since pause only breaks out, but the exectur remains there as well as
the code in
- (IBAction)pause:(id)sender
...
[pauseButt setTitle: NSLocalizedString(@"Pause", @"")];
[stopButt setEnabled: YES];
paused = NO;
[executor performOperation];
...
should just resume operation, since performOperation will work on the
same "files" array which contains the remaining work.
but what happens is that pressing the button does not get into
- (IBAction)pause:(id)sender
again, why? The button gets pressed thus gui is still responsive, it
should be almost in its initial status (I checked with top and see that
the worker thread dies with pause and the application returns
single-threaded).
Where does my performAction go??
Riccardo
_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev