Codota Logo
ForkJoinPool.deregisterWorker
Code IndexAdd Codota 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)

  • Common ways to obtain ForkJoinPool
private void myMethod () {
ForkJoinPool f =
  • Codota Iconnew ForkJoinPool(parallelism)
  • Smart code suggestions by Codota
}
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

  • Finding current android device location
  • findViewById (Activity)
  • getSystemService (Context)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now