Tabnine Logo
ForkJoinPool.deregisterWorker
Code IndexAdd Tabnine to your IDE (free)

How to use
deregisterWorker
method
in
jsr166y.ForkJoinPool

Best Java code snippets using jsr166y.ForkJoinPool.deregisterWorker (Showing top 3 results out of 315)

origin: h2oai/h2o-2

/**
 * Tries to create and start a worker
 */
private void addWorker() {
  Throwable ex = null;
  ForkJoinWorkerThread wt = null;
  try {
    if ((wt = factory.newThread(this)) != null) {
      wt.start();
      return;
    }
  } catch (Throwable e) {
    ex = e;
  }
  deregisterWorker(wt, ex); // adjust counts etc on failure
}
origin: h2oai/h2o-2

  /**
   * This method is required to be public, but should never be
   * called explicitly. It performs the main run loop to execute
   * {@link ForkJoinTask}s.
   */
  public void run() {
    Throwable exception = null;
    try {
      onStart();
      pool.runWorker(workQueue);
    } catch (Throwable ex) {
      exception = ex;
    } finally {
      try {
        onTermination(exception);
      } catch (Throwable ex) {
        if (exception == null)
          exception = ex;
      } finally {
        pool.deregisterWorker(this, exception);
      }
    }
  }
}
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Performs cleanup associated with termination of this worker
 * thread.  If you override this method, you must invoke
 * {@code super.onTermination} at the end of the overridden method.
 *
 * @param exception the exception causing this thread to abort due
 * to an unrecoverable error, or {@code null} if completed normally
 */
protected void onTermination(Throwable exception) {
  try {
    terminate = true;
    cancelTasks();
    pool.deregisterWorker(this, exception);
  } catch (Throwable ex) {        // Shouldn't ever happen
    if (exception == null)      // but if so, at least rethrown
      exception = ex;
  } finally {
    if (exception != null)
      UNSAFE.throwException(exception);
  }
}
jsr166yForkJoinPoolderegisterWorker

Javadoc

Final callback from terminating worker, as well as upon failure to construct or start a worker in addWorker. Removes record of worker from array, and adjusts counts. If pool is shutting down, tries to complete termination.

Popular methods of ForkJoinPool

  • invoke
    Performs the given task, returning its result upon completion. If the computation encounters an unch
  • <init>
    Creates a ForkJoinPool with the given parameters.
  • execute
    Arranges for (asynchronous) execution of the given task.
  • addWorker
    Tries to create and start a worker; minimally rolls back counts on failure.
  • checkPermission
    If there is a security manager, makes sure caller has permission to modify threads.
  • getParallelism
    Returns the targeted parallelism level of this pool.
  • getPoolSize
    Returns the number of worker threads that have started but not yet terminated. The result returned b
  • idleAwaitWork
    If inactivating worker w has caused pool to become quiescent, check for pool termination, and wait f
  • idlePerActive
    Returns the approximate (non-atomic) number of idle threads per active thread.
  • isTerminated
    Returns true if all tasks have completed following shut down.
  • managedBlock
    Blocks in accord with the given blocker. If the current thread is a ForkJoinWorkerThread, this metho
  • nextWorkerName
    Callback from ForkJoinWorkerThread constructor to assign a public name
  • managedBlock,
  • nextWorkerName,
  • registerWorker,
  • scan,
  • signalWork,
  • tryTerminate,
  • addActiveCount,
  • addQuiescerCount,
  • addSubmission

Popular in Java

  • Making http requests using okhttp
  • runOnUiThread (Activity)
  • setScale (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Notification (javax.management)
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now