gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GWorkspace file operation pause/stop problems


From: Riccardo Mottola
Subject: Re: GWorkspace file operation pause/stop problems
Date: Fri, 30 May 2014 15:03:26 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]