gnustep-dev
[Top][All Lists]
Advanced

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

Re: problems compiling NSAnimation.m


From: Xavier Glattard
Subject: Re: problems compiling NSAnimation.m
Date: Thu, 10 May 2007 15:03:04 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Richard Frith-Macdonald <richard <at> tiptree.demon.co.uk> writes:

> (...)
> Making it an ivar *fixes* the code to work with an older compiler

Making it an ivar breaks the class in thread mode. ;-)

> (...)
> Actually that's not correct ... the lock is an ivar and is *not*  
> local to the method, so as the lock can be modified by any method,  
> the variable to record its state similarly needs to be modified in  
> any method where the lock is modified.

The NSRecursiveLock (did you note the lock is recursive ?) is an ivar,
but the [-lock] ans [-unlock] calls are local to the method. Each method
that calls lock must call unlock.

__gs_isLocked records if [lock] has been called : if it is then [unlock]
is called before the method returns. If an other method is called before
the [unlock] then your __gs_isLocked ivar is reset 
(in the _NSANIMATION_UNLOCK of the called method) and [unlock] is never
called.

> (...)
> > Did you run GSTest ?
> 
> Nope.  Does that now test animations?

Yep. Two demos (not really 'tests').
And they run in threaded mode by default.

Xavier









reply via email to

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