(self)
return self._locked
锁定对象
锁定对象
锁定对象
def lock(self):
        '''锁定对象
        '''
        print "locked"
        if not self.isLocked():
            key = self.produceKey('_lock')
            result = memclient.mclient.add(key,1,LOCK_TIMEOUT)
            if result:
                self._timestamp=time.time()
                self._locked = result
        return self._locked
def lock ( self ) : print "locked" if not self . isLocked ( ) : key = self . produceKey ( '_lock' ) result = memclient . mclient . add ( key , 1 , LOCK_TIMEOUT ) if result : self . _timestamp = time . time ( ) self . _locked = result return self . _locked