Package java.util.concurrent

Examples of java.util.concurrent.Semaphore.release()


                    registerResourceBundle(key, resourceBundle);
                }
            } catch (InterruptedException e) {
                Thread.interrupted();
            } finally {
                loadingGuard.release();
            }
        }
        log.trace("getResourceBundleInternal({}) ==> {}", key, resourceBundle);
        return resourceBundle;
    }
View Full Code Here


                        Matrix contexts = getTermContexts(i, termFeatures[i]);
                        senseInduce(term, contexts);
                        } catch (IOException ioe) {
                            ioe.printStackTrace();
                        } finally {
                            termsProcessed.release();
                        }                      
                    }
                });
        }
       
View Full Code Here

                        // Scale the associated result to within the test's
                        // range of values
                        compScores[index] =
                            (association * testRange) + getLowestScore();
                    }
                    itemsProcessed.release();
                }
            });
        }
               
        // Wait
View Full Code Here

                        // This method creates the document vector and then adds
                        // that document vector with the reflective semantic
                        // vector for each word occurring in the document
                        LOGGER.fine("reprocessing doc #" + docId);
                        processIntDocument(docToVector.get(docId), doc);
                        documentsRerocessed.release();
                    }
                });
        }
        corpusReader.close();
View Full Code Here

                        synchronized(numExecutingOutputs)
                        {
                           numExecutingOutputs.decrementAndGet();
                           numExecutingOutputs.notifyAll();
                        }
                        if (taskSepaphore != null) taskSepaphore.release();
                     }
                  }
               };

               synchronized(numExecutingOutputs)
View Full Code Here

                     executorService.execute(task);
                  }
                  catch (RejectedExecutionException e)
                  {
                     // this may happen because of a race condition between the
                     taskSepaphore.release();
                     wrapper.releaseLock(); // we never got into the run so we need to release the lock
                  }
                  catch (InterruptedException e)
                  {
                     // this can happen while blocked in the semaphore.acquire.
View Full Code Here

        Semaphore sem =this.idtoSem.get(id);
        LOG.debug("Received result " +result+ " for id " +id+ " at " +(System.currentTimeMillis()));
        if(sem!=null)
        {
            this.idtoResult.put(id,result);
            sem.release();
        }

    }

    @Override
View Full Code Here

        Semaphore sem =this.idtoSem.get(id);
        LOG.debug("failRequest result  for id " +id+ " at " +(System.currentTimeMillis()));
        if(sem!=null)
        {
            this.idtoResult.put(id,new DRPCExecutionException( "Request failed"));
            sem.release();
        }       
    }

    @Override
    public void shutdown() {
View Full Code Here

                    String id=e.getKey();
                    Drpc.this.idtoResult.put(id, new DRPCExecutionException("Request timed out"));
                    Semaphore s=Drpc.this.idtoSem.get(id);
                    if(s!=null)
                    {
                        s.release();
                    }
                    set.add(id);
                }
            }
   
View Full Code Here

        // Wait for the renderer to become ready
        rb.setBufferUpdater(new BufferUpdater() {

            public void init(RenderBuffer arg0) {
                logger.info("RENDERER IS READY !");
                waitForReady.release();

                // OWL issue #14: ignore repaints after the first to avoid
                // flickering on Windows. The first paint is necessary to
                // setup the canvas.  Once we get to this point, the canvas
                // is initialized, and we can ignore further repaints.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.