parameters: (fn)
return_statement: return sync
docstring: Synchronizes file I/O for methods in GFileBase.
docstring_summary: Synchronizes file I/O for methods in GFileBase.
docstring_tokens: Synchronizes file I / O for methods in GFileBase .
function: def _synchronized(fn):
      """Synchronizes file I/O for methods in GFileBase."""
      @functools.wraps(fn)
      def sync(self, *args, **kwargs):
        # Sometimes a GFileBase method is called before the instance
        # has been properly initialized.  Check that _locker is available.
        if hasattr(self, '_locker'): self._locker.lock()
        try:
          return fn(self, *args, **kwargs)
        finally:
          if hasattr(self, '_locker'): self._locker.unlock()
      return sync
function_tokens: def _synchronized ( fn ) : @ functools . wraps ( fn ) def sync ( self , * args , * * kwargs ) : # Sometimes a GFileBase method is called before the instance # has been properly initialized.  Check that _locker is available. if hasattr ( self , '_locker' ) : self . _locker . lock ( ) try : return fn ( self , * args , * * kwargs ) finally : if hasattr ( self , '_locker' ) : self . _locker . unlock ( ) return sync