Run the main windows message loop.
540521
def WinMSGLoop():
    """"""
    LPMSG = POINTER(MSG)
    LRESULT = c_ulong
    GetMessage = get_winfunc("user32", "GetMessageW", BOOL, (LPMSG, HWND, UINT, UINT))
    TranslateMessage = get_winfunc("user32", "TranslateMessage", BOOL, (LPMSG,))
    # restype = LRESULT
    DispatchMessage = get_winfunc("user32", "DispatchMessageW", LRESULT, (LPMSG,))

    msg = MSG()
    lpmsg = byref(msg)
    while GetMessage(lpmsg, HWND(), 0, 0) > 0:
        TranslateMessage(lpmsg)
        DispatchMessage(lpmsg)
780846
public void run()
    {
        BaseMessage internalTrxMessage = (BaseMessage)this.getTargetMessage();      // Create my standard message.
        if (internalTrxMessage != null)
        {
            // Get the transport type from the header and merge the transport properties with my header properties.
            BaseMessageTransport transport = this.getMessageTransport(internalTrxMessage);
            transport.sendMessage(internalTrxMessage, this);
            transport.free();
        }
    }
197008
def main(**kwargs):
    """"""
    options = ApplicationOptions(**kwargs)
    Event.configure(is_logging_enabled=options.event_logging)
    application = Application(options)
    application.run(options.definition)
1173444
def run(self):
        """"""
        with utils.ChangeDir(self.dirname):
            sys.path.insert(0, self.dirname)
            sys.argv[1:] = self.args
            runpy.run_module(self.not_suffixed(self.filename),
                             run_name='__main__',
                             alter_sys=True)
634197
def run(stop_message = '', &block)
      job(&block)
      auto_spin

      @work = Thread.new { execute_job }
      @work.join
    ensure
      stop(stop_message)
    end
748946
def run(self):
        '''
        
        '''
        global _global_kill

        for message in self._messages:

            # Get the message contents from the batch file
            batch_file = self._getBatchFile(message)
            message_contents = batch_file.getMessage(message)
            self._logger.debug(
                'Read message {:}, waiting to be put into queue'
                .format(message))

            # Then repeatedly try to put the contents into the queue,
            # occasionally timing out so that we might catch the kill signal
            put_succeeded = False
            while not put_succeeded:

                if _global_kill.isSet():
                    return

                try:
                    self._queue.put(message_contents, block=True, timeout=1.0)
                except Full:
                    pass
                else:
                    put_succeeded = True
                    self._logger.debug('Message put into queue')
677477
def main(args=None, **kwargs):
    """"""
    LOG.info('Starting %s', __service_id__)
    return run([SDPMasterDevice], verbose=True, msg_stream=sys.stdout,
               args=args, **kwargs)
69088
def run_app(self):
        """"""
        # Update system arguments
        sys.argv[0] = sys.executable
        sys.argv[1] = '{}.py'.format(sys.argv[1])

        # Make sure to exit with the return value from the subprocess call
        self._app_process = subprocess.Popen(sys.argv)
        return self._app_process.wait()
289584
def run(self):
        
        self.main_task.thread.start()
        self.main_task.thread.join()
182188
def run(self):
        """"""
        for msg in self.messages:
            col = getattr(msg, 'col', 0)
            yield msg.lineno, col, (msg.tpl % msg.message_args), msg.__class__
1007631
def run(self):
        """"""
        event_handler = Handler()
        threads = []
        paths = [os.path.join(cwd, "content"), os.path.join(cwd, "templates")]

        for i in paths:
            targetPath = str(i)
            self.observer.schedule(event_handler, targetPath, recursive=True)
            threads.append(self.observer)

        self.observer.start()

        try:
            while True:
                time.sleep(5)
        except:
            self.observer.stop()
            print("\nObserver stopped.")

        self.observer.join()
65565
def _run_loop(self, session):
        
        try:
            first_prompt = True

            # Set up the prompt
            prompt = (
                self._readline_prompt
                if readline is not None
                else self._normal_prompt
            )

            while not self._stop_event.is_set():
                # Wait for the shell to be there
                # Before Python 2.7, wait() doesn't return a result
                if self._shell_event.wait(.2) or self._shell_event.is_set():
                    # Shell present
                    if first_prompt:
                        # Show the banner on first prompt
                        sys.stdout.write(self._shell.get_banner())
                        first_prompt = False

                    # Read the next line
                    line = prompt()

                    with self._lock:
                        if self._shell_event.is_set():
                            # Execute it
                            self._shell.execute(line, session)

                        elif not self._stop_event.is_set():
                            # Shell service lost while not stopping
                            sys.stdout.write("Shell service lost.")
                            sys.stdout.flush()
        except (EOFError, KeyboardInterrupt, SystemExit):
            # Input closed or keyboard interruption
            pass
907939
protected function _mainLoop()
	{
		while (true) {
			pcntl_signal_dispatch();

			if (posix_getppid() != $this->_nParentPid) {
				$this->_log("INFO: Parent process {$this->_nParentPid} died unexpectedly, exiting...");
				break;
			}

			sem_acquire($this->_hSem);
			$this->_setQueue(self::SHM_ERROR_MESSAGES_QUEUE_KEY, 0,
				array_merge($this->_getQueue(self::SHM_ERROR_MESSAGES_QUEUE_KEY), parent::getErrors())
			);

			$aQueue = $this->_getQueue(self::SHM_MESSAGES_QUEUE_KEY_START, $this->_nCurrentProcess);
			foreach($aQueue as $message) {
				parent::add($message);
			}
			$this->_setQueue(self::SHM_MESSAGES_QUEUE_KEY_START, $this->_nCurrentProcess);
			sem_release($this->_hSem);

			$nMessages = count($aQueue);
			if ($nMessages > 0) {
				$this->_log('INFO: Process ' . ($this->_nCurrentProcess + 1) . " has {$nMessages} messages, sending...");
				parent::send();
			} else {
				usleep(self::MAIN_LOOP_USLEEP);
			}
		}
	}
443447
def run(self):
    """"""

    if not (self._watchman and self._watchman.is_alive()):
      raise PantsService.ServiceError('watchman is not running, bailing!')

    # Enable watchman for the build root.
    self._watchman.watch_project(self._build_root)

    subscriptions = list(self._handlers.values())

    # Setup subscriptions and begin the main event firing loop.
    for handler_name, event_data in self._watchman.subscribed(self._build_root, subscriptions):
      self._state.maybe_pause()
      if self._state.is_terminating:
        break

      if event_data:
        # As we receive events from watchman, trigger the relevant handlers.
        self.fire_callback(handler_name, event_data)
572960
def main():
    """"""
    # Helper method so that the coroutine exits cleanly if an exception
    # happens (which would leave resources dangling)
    async def _run_application(loop):
        try:
            return await cli_handler(loop)

        except KeyboardInterrupt:
            pass  # User pressed Ctrl+C, just ignore it

        except SystemExit:
            pass  # sys.exit() was used - do nothing

        except:  # pylint: disable=bare-except  # noqa
            import traceback

            traceback.print_exc(file=sys.stderr)
            sys.stderr.writelines(
                '\n>>> An error occurred, full stack trace above\n')

        return 1

    try:
        loop = asyncio.get_event_loop()
        return loop.run_until_complete(_run_application(loop))
    except KeyboardInterrupt:
        pass

    return 1
981426
public void run() {

        while (!stop) {
            try {
                //  Poll the sockets inputs
                pollers.poll();

                //  read the speaking one
                for (int i=0 ; i<pollers.getSize() ; i++) {
                    if (pollers.pollin(i)) {
                        manageInputBuffer(i);
                    }
                }
            }
            catch (Error | Exception e) {
                e.printStackTrace();
            }
        }
        ApiUtil.printTrace("------------ End of ZmqMainThread ---------------");
    }
447349
def start(self):
        
        self.thread_handler.run(target=self.start_blocking)
        self.thread_handler.start_run_loop()