Example #1
0
File: Face.py Project: cawka/PyNDN
 def run(self, timeoutms):
     assert not _pyndn.is_run_executing(self.ndn_data), "Command should be called when ndn_run is not running"
     self._handle_lock.acquire()
     try:
         _pyndn.run(self.ndn_data, timeoutms)
     finally:
         self._handle_lock.release()
Example #2
0
 def run(self, timeoutms):
     assert not _pyndn.is_run_executing(
         self.ndn_data
     ), "Command should be called when ndn_run is not running"
     self._handle_lock.acquire()
     try:
         _pyndn.run(self.ndn_data, timeoutms)
     finally:
         self._handle_lock.release()
Example #3
0
 def output_is_pending(self):
     assert not _pyndn.is_run_executing(
         self.ndn_data
     ), "Command should be called when ndn_run is not running"
     return _pyndn.output_is_pending(self.ndn_data)
Example #4
0
 def process_scheduled(self):
     assert not _pyndn.is_run_executing(
         self.ndn_data
     ), "Command should be called when ndn_run is not running"
     return _pyndn.process_scheduled_operations(self.ndn_data)
Example #5
0
 def _release_lock(self, tag):
     if not _pyndn.is_run_executing(self.ndn_data):
         #            print("%s: releasing lock" % tag)
         self._handle_lock.release()
Example #6
0
 def _acquire_lock(self, tag):
     if not _pyndn.is_run_executing(self.ndn_data):
         #            print("%s: acquiring lock" % tag)
         self._handle_lock.acquire()
Example #7
0
File: Face.py Project: cawka/PyNDN
 def output_is_pending(self):
     assert not _pyndn.is_run_executing(self.ndn_data), "Command should be called when ndn_run is not running"
     return _pyndn.output_is_pending(self.ndn_data)
Example #8
0
File: Face.py Project: cawka/PyNDN
 def process_scheduled(self):
     assert not _pyndn.is_run_executing(self.ndn_data), "Command should be called when ndn_run is not running"
     return _pyndn.process_scheduled_operations(self.ndn_data)
Example #9
0
File: Face.py Project: cawka/PyNDN
    def _release_lock(self, tag):
        if not _pyndn.is_run_executing(self.ndn_data):
#            print("%s: releasing lock" % tag)
            self._handle_lock.release()
Example #10
0
File: Face.py Project: cawka/PyNDN
    def _acquire_lock(self, tag):
        if not _pyndn.is_run_executing(self.ndn_data):
#            print("%s: acquiring lock" % tag)
            self._handle_lock.acquire()
Example #11
0
 def stop(self):
     self.running = False
     for fd, handle in zip(self.fds.keys(), self.fds.values()):
         # disconnect only when nothing is running, otherwise segfaul guaranteed
         if not _pyndn.is_run_executing(handle.ndn_data):
             handle.disconnect()
Example #12
0
 def stop(self):
     self.running = False
     for fd, handle in zip(self.fds.keys(), self.fds.values()):
         # disconnect only when nothing is running, otherwise segfaul guaranteed
         if not _pyndn.is_run_executing (handle.ndn_data):
             handle.disconnect ()