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: Fred Kiefer
Subject: Re: GWorkspace file operation pause/stop problems
Date: Fri, 30 May 2014 14:50:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 30.05.2014 14:31, Riccardo Mottola wrote:
> Hi,
> 
> I'm trying to debug a problem with GWorkspace.
> File operations (copy, move, trash...) have a progress bar with two
> buttons: pause and stop. If one hits pause, stops disables and pause
> becomes "continue".
> 
> At each copy cycle in doCopy() or any other object, which wlask through
> top-level objetcs and not its content, so if you move just one directory
> you wont' have a chance to interrupt, essentially, checks if "paused" or
> "stopped" are set.
> 
> The problem is that hitting "continue" does nothing, the operation does
> not resume. With some NSLogs, I traced it that the action of the button
> appears to do nothing. IBAction pause at line 317 gets called on pause,
> but not on continue.
> 
> I tried to check for exceptions, but a breakpoint in [NSException raise]
> shows nothing. The continue button just remains pressed.
> 
> To debug, it is better to copy many small files at top level, not a
> single directory with many files.
> 
> The relevant file is:
> Operation/FileOpInfo.m
> 
> For debugging copy operations, you might want to insert a sleep(1) in
> the doCopy method, line 961.
> 
> During the operation, a thread is spawned, so there is some reaction
> time, but pausing does work. That could be improved, but is not the
> problem I want to debug now.
> 
> The actual action is Operation.m
> 
> Clues? Hints?

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.


Hope this helps,
Fred




reply via email to

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