gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject cvs commit: gump/python/gump/model object.py
Date Tue, 29 Jun 2004 20:52:02 GMT
ajack       2004/06/29 13:52:02

  Modified:    python/gump/runner Tag: CleanUp demand.py
               python/gump/model Tag: CleanUp object.py
  Log:
  Hmm, not acting like it respects locks... hmm ...
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.3.2.3   +6 -9      gump/python/gump/runner/demand.py
  
  Index: demand.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/runner/demand.py,v
  retrieving revision 1.3.2.2
  retrieving revision 1.3.2.3
  diff -u -r1.3.2.2 -r1.3.2.3
  --- demand.py	29 Jun 2004 19:30:41 -0000	1.3.2.2
  +++ demand.py	29 Jun 2004 20:52:02 -0000	1.3.2.3
  @@ -82,8 +82,7 @@
           
       def performUpdate(self,module):
           """
  -        	Perform
  - 	
  +        	Perform a module update (locking whilst doing it)	
           """
           
           # Lock the module, while we work on it...
  @@ -95,10 +94,7 @@
               if not module.isUpdated():
                   
                   # Perform Update
  -                self.updater.updateModule(module)        
  -        
  -                # Mark Updated
  -                module.setUpdated(True) #:TODO: Move this...
  +                self.updater.updateModule(module)         
           
                   # Fire event
                   self.run.generateEvent(module)
  @@ -106,10 +102,10 @@
                   # Mark done in set
                   self.run.gumpSet.setCompletedModule(module)
                   
  +                # Mark Updated
  +                module.setUpdated(True)
           finally:
  -            
  -            if lock:
  -                lock.release()
  +            lock.release()
           
       ###########################################
   
  @@ -130,6 +126,7 @@
               # Process the module, upon demand
               module=project.getModule()
               if not module.isUpdated():
  +                log.debug('Update module *inlined* ' + `module` + '.')     
                   self.performUpdate(module)
   
               # Process
  
  
  
  No                   revision
  No                   revision
  1.24.2.12 +7 -7      gump/python/gump/model/object.py
  
  Index: object.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/model/object.py,v
  retrieving revision 1.24.2.11
  retrieving revision 1.24.2.12
  diff -u -r1.24.2.11 -r1.24.2.12
  --- object.py	29 Jun 2004 19:30:43 -0000	1.24.2.11
  +++ object.py	29 Jun 2004 20:52:02 -0000	1.24.2.12
  @@ -67,9 +67,6 @@
       	
           self.resolutionPerformed=False
           self.completionPerformed=False
  -        
  -        from threading import Lock
  -        self.lock=Lock()
       	
       def __del__(self):
           Annotatable.__del__(self)
  @@ -96,10 +93,7 @@
                   self.element=None
               self.dom=None
               
  -        self.shutdownWork()
  -        
  -    def getLock(self):
  -        return self.lock
  +        self.shutdownWork() 
       
       def isResolved(self):
           return self.resolutionPerformed
  @@ -288,6 +282,9 @@
       	    raise RuntimeError, self.__class__.__name__ + ' needs a name.'
               
           self.hash=0
  +        
  +        from threading import RLock
  +        self.lock=RLock()
         
       #
       # Same if same type, and same name
  @@ -311,6 +308,9 @@
   
       def getName(self):
           return self.name
  +        
  +    def getLock(self):
  +        return self.lock
           
       def dump(self, indent=0, output=sys.stdout):
           """ Display the contents of this object """
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Mime
View raw message