Package freenet.node

Examples of freenet.node.PrioRunnable


        return true;
      }
     
    }, NativeThread.HIGH_PRIORITY);
    } else {
      server.core.getExecutor().execute(new PrioRunnable() {

        @Override
        public int getPriority() {
          return NativeThread.NORM_PRIORITY;
        }
View Full Code Here


  public void scheduleTimeoutAfterBlockSends() {
    synchronized(_senderThread) {
      if(_receivedSendCompletion) return;
      if(timeoutJob != null) return;
      if(logMINOR) Logger.minor(this, "Scheduling timeout on "+this);
      timeoutJob = new PrioRunnable() {
       
        @Override
        public void run() {
          String timeString;
          String abortReason;
View Full Code Here

      }
    }
  }
 
  private void callAllSentCallbackInner(final boolean anyFailed) {
    prb.usm.getExecutor().execute(new PrioRunnable() {

      @Override
      public void run() {
        allSentCallback.allSent(BulkTransmitter.this, anyFailed);
      }
View Full Code Here

 
  public void testBlocking() {
    SerialExecutor exec = new SerialExecutor(NativeThread.NORM_PRIORITY);
    exec.start(new PooledExecutor(), "test");
    final MutableBoolean flag = new MutableBoolean();
    exec.execute(new PrioRunnable() {

      @Override
      public void run() {
        try {
          // Do nothing
View Full Code Here

    }
   
    private synchronized void startJob(final MemoryLimitedJob job) {
        counter += job.initialAllocation;
        runningThreads++;
        executor.execute(new PrioRunnable() {

            @Override
            public void run() {
                MemoryLimitedChunk chunk = new MemoryLimitedChunk(MemoryLimitedJobRunner.this, job.initialAllocation);
                if(job.start(chunk))
View Full Code Here

    }

    @Override
    public void queue(final PersistentJob job, final int priority) {
        if(logMINOR) Logger.minor(this, "Running job off thread: "+job);
        executor.execute(new PrioRunnable() {

            @Override
            public void run() {
                if(logMINOR) Logger.minor(this, "Starting job "+job);
                job.run(context);
View Full Code Here

      Closer.close(pipeOut);
    }

    final FetchResult result = new FetchResult(clientMetadata, finalResult);
    context.uskManager.updateKnownGood(origUSK, state.getToken(), context);
    context.mainExecutor.execute(new PrioRunnable() {

      @Override
      public void run() {
        cb.onFound(origUSK, state.getToken(), result);
      }
View Full Code Here

    if(offeredKeys != null) {
      offeredKeys.remove(block.getKey());
    }
    final Key key = block.getKey();
    if(schedTransient.anyProbablyWantKey(key, clientContext)) {
      this.clientContext.mainExecutor.execute(new PrioRunnable() {

        @Override
        public void run() {
          schedTransient.tripPendingKey(key, block, clientContext);
        }
View Full Code Here

        Logger.error(this, "caught: "+e.getMessage(), e);
        continue;
      }
     
      final CompressJob finalJob = currentJob;
      exec.execute(new PrioRunnable() {
        @Override
        public void run() {
          freenet.support.Logger.OSThread.logPID(this);
          try {
              try {
View Full Code Here

          }
         
        }, NativeThread.NORM_PRIORITY+1);
      } else {
        // We do it off thread so that RealCompressor can release the semaphore
        context.mainExecutor.execute(new PrioRunnable() {

          @Override
          public int getPriority() {
            return NativeThread.NORM_PRIORITY;
          }
View Full Code Here

TOP

Related Classes of freenet.node.PrioRunnable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.