def _create_pipes(self):
# Creates named pipe for inter-process communication
self.pipe_name = seeding.hash_seed(None) % 2 ** 32
self.launch_vars['pipe_name'] = self.pipe_name
if not self.disable_out_pipe:
self.path_pipe_out = '%s-out.%d' % (self.path_pipe_prefix, self.pipe_name)
os.mkfifo(self.path_pipe_out)
# Launching a thread that will listen to incoming pipe
# Thread exits if self.is_exiting = 1 or pipe_in is closed
if not self.disable_in_pipe:
thread_incoming = Thread(target=self._listen_to_incoming_pipe, kwargs={'pipe_name': self.pipe_name})
thread_incoming.start()
# Cannot open output pipe now, otherwise it will block until
# a reader tries to open the file in read mode - Must launch fceux first
评论列表
文章目录