Exemple #1
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()
Exemple #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()
Exemple #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)
Exemple #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)
Exemple #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()
Exemple #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()
Exemple #7
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)
Exemple #8
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)
Exemple #9
0
    def _release_lock(self, tag):
        if not _pyndn.is_run_executing(self.ndn_data):
#            print("%s: releasing lock" % tag)
            self._handle_lock.release()
Exemple #10
0
    def _acquire_lock(self, tag):
        if not _pyndn.is_run_executing(self.ndn_data):
#            print("%s: acquiring lock" % tag)
            self._handle_lock.acquire()
Exemple #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()
Exemple #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 ()