Calls {@code action.run()}.
481007
public static <T> T
        doPrivileged(PrivilegedExceptionAction<T> action)
        throws PrivilegedActionException {
        try {
            return action.run();
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new PrivilegedActionException(e);
        }
    }
135196
@Override
    public final void run() {
        try {
            this.runWithException();
        } catch (RuntimeException e) {
            throw e;
        } catch (Error e) {
            throw e;
        } catch (Throwable t) {
            throw new RuntimeException(t);
        }
    }
1358885
def run(self):
        

        if self.args['add']:
            self.action_add()

        elif self.args['rm']:
            self.action_rm()

        elif self.args['show']:
            self.action_show()

        elif self.args['rename']:
            self.action_rename()

        else:
            self.action_run_command()
1193021
public void run()
    {
        try
        {
            log.debug("CLOCK: Starting server-side thread");

            while (active)
            {
                Collection<ScriptSession> sessions = sctx.getScriptSessionsByPage("/dwr/clock/index.html");
                Util pages = new Util(sessions);
                pages.setValue("clockDisplay", new Date().toString());

                log.debug("Sent message");
                Thread.sleep(1000);
            }

            Collection<ScriptSession> sessions = sctx.getScriptSessionsByPage("/dwr/clock/index.html");
            Util pages = new Util(sessions);
            pages.setValue("clockDisplay", "");

            log.debug("CLOCK: Stopping server-side thread");
        }
        catch (InterruptedException ex)
        {
            ex.printStackTrace();
        }
    }
1304475
@Override
	public synchronized void run()
    {
        if (!start())
        	return;
        
        try
        {
        	inRunnableMode = true;
        	while (!stopRequired)
        		wait();
        }
        catch (InterruptedException e)
        {
        	log.error("Server was interrupted.");
        }
        
        shutdown();      
    }
486445
public function run() {
		$array = ValueUtils::val($this->array);
		foreach ($array as $key => $value) {
			if ($this->key != null) {
				$this->key->setValue($key);
			}
			if ($this->value != null) {
				$this->value->setValue($value);
			}
			foreach ($this->actions as $action) {
				$action->run();
			}
		}
	}
1127697
public void actionPerformed(java.awt.event.ActionEvent actionEvent)
    {
        new Thread()
        {
            public void run()
            {
                final java.sql.Connection conn = new JDlgDBConnection(containingFrame, false).showAndReturnConnection();
                if (conn != null)
                {
                    javax.swing.SwingUtilities.invokeLater(new Runnable()
                    {
                        public void run()
                        {
                            JIFrmDatabase frm = new JIFrmDatabase(conn);
                            containingFrame.getContentPane().add(frm);
                            frm.setVisible(true);
                        }
                    });
                }
            }
        }.start();
    }
855204
@Override
    public void run() {
	try {
	    try {
		turnsControl.waitTurns(1, "Robot starting"); // block at the beginning so that all
							     // robots start at the
		// same time
	    } catch (BankInterruptedException exc) {
		log.trace("[run] Interrupted before starting");
	    }

	    assert getData().isEnabled() : "Robot is disabled";

	    mainLoop();

	    log.debug("[run] Robot terminated gracefully");
	} catch (Exception | Error all) {
	    log.error("[run] Problem running robot " + this, all);
	    die("Execution Error -- " + all);
	}
    }
1133638
public void run()
  {

    m_hasBeenReset = false;

    try
    {

      // int n = ((SourceTreeHandler)getInputContentHandler()).getDTMRoot();
      // transformNode(n);
      try
      {
        // m_isTransformDone = false; // android-removed
        
        // Should no longer be needed...
//          if(m_inputContentHandler instanceof TransformerHandlerImpl)
//          {
//            TransformerHandlerImpl thi = (TransformerHandlerImpl)m_inputContentHandler;
//            thi.waitForInitialEvents();
//          }

        transformNode(m_doc);
        
      }
      catch (Exception e)
      {
        // e.printStackTrace();

        // Strange that the other catch won't catch this...
        if (null != m_transformThread)
          postExceptionFromThread(e);   // Assume we're on the main thread
        else 
          throw new RuntimeException(e.getMessage());
      }
      finally
      {
        // m_isTransformDone = true; // android-removed

        if (m_inputContentHandler instanceof TransformerHandlerImpl)
        {
          ((TransformerHandlerImpl) m_inputContentHandler).clearCoRoutine();
        }

        //        synchronized (this)
        //        {
        //          notifyAll();
        //        }
      }
    }
    catch (Exception e)
    {

      // e.printStackTrace();
      if (null != m_transformThread)
        postExceptionFromThread(e);
      else 
        throw new RuntimeException(e.getMessage());         // Assume we're on the main thread.
    }
  }
1360963
public void
run() {
	try {
		Message response = res.send(query);
		listener.receiveMessage(id, response);
	}
	catch (Exception e) {
		listener.handleException(id, e);
	}
}
528031
@Override
    public void run() {
        try {
            if (this.isDone()) {
                return;
            }
            ExpeditedFutureTask<V> futureTask = new ExpeditedFutureTask<V>(this.m_callable);
            this.m_defaultFuture = futureTask;
            this.m_executor.execute(futureTask);
            this.m_scheduledExecutorQueue.remove(this);
        } catch (Exception e) {
            this.m_pendingException = new RuntimeException(e);
            return;
        } finally {
            // Let blocked ScheduleFuture methods thru now.
            this.m_coordinationLatch.countDown();
        }
    }
877245
public void start() {
        if(actionInBackground != null) {

            Runnable jobToRun = new Runnable() {
                @Override
                public void run() {
                    result = (JobResult) actionInBackground.doAsync();
                    onResult();
                }
            };

            if(getExecutorService() != null) {
               asyncFutureTask = (FutureTask) getExecutorService().submit(jobToRun);
            } else {
                asyncThread = new Thread(jobToRun);
                asyncThread.start();
            }
        }
    }
535514
@Override
  public void run()
  {
    try {
      _launcher.onChildIdleBegin();
      _launcher.onChildThreadLaunchBegin();
      _pool.addThread(this);
      
      runTasks();
    } catch (Throwable e) {
      log.log(Level.WARNING, e.toString(), e);
    } finally {
      _pool.removeThread(this);
      _launcher.onChildIdleEnd();
      _launcher.onChildThreadLaunchEnd();
    }
  }
547364
@TaskAction
  public void runAction() throws AppEngineException, ProjectConfigurationException {
    devServers
        .newDevAppServer(CloudSdkOperations.getDefaultHandler(getLogger()))
        .run(runConfig.toRunConfiguration());
  }
1043892
public void run() {
    while (keep_running) {
      try {
        // tell controller to do some real work for a change
        controller.process();

        // waiting check_interval ms, while taking sleep_interval ms
        // long naps so we can break off faster if the server is shut
        // down
        long wait_start = System.currentTimeMillis();
        do {
          Thread.sleep(sleep_interval);
        } while (keep_running &&
                 (System.currentTimeMillis() - wait_start) < check_interval);

      } catch (Throwable e) {
        controller.reportError(e);
        try {
          Thread.sleep(getErrorWaitInteral()); // wait a good while, then retry
        } catch (InterruptedException e2) {
        }
      }
    }
    controller.reportStopped();
  }
318476
@Override
	public void run() {
		if (logger.isInfoEnabled()) {
			logger.info(String.format("SelectorThread for Management=%s started.", this.management.getName()));
		}
		while (this.started) {
			try {
				FastList<ChangeRequest> pendingChanges = this.management.getPendingChanges();

				// Process any pending changes
				synchronized (pendingChanges) {
					Iterator<ChangeRequest> changes = pendingChanges.iterator();
					while (changes.hasNext()) {
						ChangeRequest change = changes.next();
						switch (change.getType()) {
						case ChangeRequest.CHANGEOPS:
							pendingChanges.remove(change);
							SelectionKey key = change.getSocketChannel().keyFor(this.selector);
							key.interestOps(change.getOps());
							break;
						case ChangeRequest.REGISTER:
							pendingChanges.remove(change);
							SelectionKey key1 = change.getSocketChannel().register(this.selector, change.getOps());
							key1.attach(change.getAssociation());
							break;
						case ChangeRequest.CONNECT:
							if (!change.getAssociation().isStarted()) {
								// if Association is stopped - remove pending connection requests  
								pendingChanges.remove(change);
							} else {
								if (change.getExecutionTime() <= System.currentTimeMillis()) {
									pendingChanges.remove(change);
									change.getAssociation().initiateConnection();
								}
							}
							break;
						case ChangeRequest.CLOSE:
							pendingChanges.remove(change);
							change.getAssociation().close();
						}
					}// end of while
				}

				// Wait for an event one of the registered channels
				this.selector.select(500);

				// System.out.println("Done selecting " +
				// this.selector.selectedKeys().size());

				// Iterate over the set of keys for which events are available
				Iterator<SelectionKey> selectedKeys = this.selector.selectedKeys().iterator();

				while (selectedKeys.hasNext()) {
					SelectionKey key = selectedKeys.next();
					selectedKeys.remove();

					if (!key.isValid()) {
						continue;
					}

					// Check what event is available and deal with it
					if (key.isConnectable()) {
						this.finishConnection(key);
					} else if (key.isAcceptable()) {
						this.accept(key);
					} else if (key.isReadable()) {
						this.read(key);
					} else if (key.isWritable()) {
						this.write(key);
					}
				}

			} catch (Exception e) {
				logger.error("Error while selecting the ready keys", e);
			}
		}

		try {
			this.selector.close();
		} catch (IOException e) {
			logger.error(String.format("Error while closing Selector for SCTP Management=%s", this.management.getName()));
		}

		if (logger.isInfoEnabled()) {
			logger.info(String.format("SelectorThread for Management=%s stopped.", this.management.getName()));
		}
	}
536913
@Override
	public void run() {

		final Map<String, WatchEventItem> eventQueue = new LinkedHashMap<>();

		while (running) {

			if (!Services.getInstance().isInitialized()) {

				try { Thread.sleep(100); } catch (InterruptedException i) {}

				// loop until we are stopped
				continue;
			}

			synchronized (watchedRoots) {

				for (final FolderInfo info : watchedRoots.values()) {

					if (info.shouldScan()) {

						// update last scanned timestamp
						info.setLastScanned(System.currentTimeMillis());

						// start a new scan thread
						new Thread(new ScanWorker(false, Paths.get(info.getRoot()), info.getRoot(), true)).start();
					}
				}
			}

			try {

				final WatchKey key = watchService.poll(100, TimeUnit.MILLISECONDS);
				if (key != null && Services.getInstance().isInitialized()) {

					final Path root;

					// synchronize access to map but keep critical section short
					synchronized (watchKeyMap) {
						root = watchKeyMap.get(key);
					}

					if (root != null) {

							for (final WatchEvent event : key.pollEvents()) {

								final Kind kind = event.kind();

								if (OVERFLOW.equals(kind)) {
									continue;
								}

								addToQueue(eventQueue, new WatchEventItem(root, (Path)key.watchable(), event));
							}

							key.reset();

					} else {

						key.cancel();
					}
				}

			} catch (InterruptedException ex) {
				ex.printStackTrace();
			}

			final SecurityContext securityContext = SecurityContext.getSuperUserInstance();

			try (final Tx tx = StructrApp.getInstance(securityContext).tx(true, true, false)) {

				// handle all watch events that are older than 2 seconds
				for (final Iterator<WatchEventItem> it = eventQueue.values().iterator(); it.hasNext();) {

					final WatchEventItem item = it.next();
					if (item.olderThan(2000)) {

						handleWatchEvent(true, item);

						it.remove();
					}
				}

				tx.success();

			} catch (Throwable t) {

				t.printStackTrace();
			}

		}

		logger.info("DirectoryWatchService stopped");
	}