mil.dod.th.ose.core/src/mil/dod/th/ose/core/impl/asset/ScannerManagerThread.java
private boolean runCheckForScanning(final int numThreads)
    {
        boolean acquiredSemaphore = false;
        try
        {
            final int TIMEOUT = 15;
            // wait for each scanner thread as each will release a permit
            acquiredSemaphore = m_Semaphore.tryAcquire(numThreads, TIMEOUT, TimeUnit.SECONDS);
        }
        catch (final InterruptedException e)
        {
            Logging.log(LogService.LOG_WARNING, e, "Scanning for assets interrupted.");
        }

        // if did not acquire semaphore then not completed scanning within amount of time.
        if (!acquiredSemaphore)
        {
            Logging.log(LogService.LOG_WARNING, "Scanning for assets did not complete. Stopping scanning now.");
        }

        // whether all scans completed successfully or not, the scanning operation is complete.
        m_ScanListener.allScannersCompleted();

        return acquiredSemaphore;
    }
/**
     * Checks to see if threads are still scanning for assets.
     * 
     * @param numThreads
     *            Number of scanning threads that were created
     * 
     * @return True if semaphore was successfully acquired; false otherwise.
     */
Checks to see if threads are still scanning for assets.

@param numThreads
Number of scanning threads that were created

@return True if semaphore was successfully acquired; false otherwise.
Checks to see if threads are still scanning for assets . @param numThreads Number of scanning threads that were created @return True if semaphore was successfully acquired ; false otherwise .
private boolean runCheckForScanning(final int numThreads)
    {
        boolean acquiredSemaphore = false;
        try
        {
            final int TIMEOUT = 15;
            acquiredSemaphore = m_Semaphore.tryAcquire(numThreads, TIMEOUT, TimeUnit.SECONDS);
        }
        catch (final InterruptedException e)
        {
            Logging.log(LogService.LOG_WARNING, e, "Scanning for assets interrupted.");
        }
        if (!acquiredSemaphore)
        {
            Logging.log(LogService.LOG_WARNING, "Scanning for assets did not complete. Stopping scanning now.");
        }
        m_ScanListener.allScannersCompleted();
        return acquiredSemaphore;
    }
private boolean runCheckForScanning ( final int numThreads ) { boolean acquiredSemaphore = false ; try { final int TIMEOUT = 15 ; acquiredSemaphore = m_Semaphore . tryAcquire ( numThreads , TIMEOUT , TimeUnit . SECONDS ) ; } catch ( final InterruptedException e ) { Logging . log ( LogService . LOG_WARNING , e , "Scanning for assets interrupted." ) ; } if ( ! acquiredSemaphore ) { Logging . log ( LogService . LOG_WARNING , "Scanning for assets did not complete. Stopping scanning now." ) ; } m_ScanListener . allScannersCompleted ( ) ; return acquiredSemaphore ; }
Checks to see if threads are still scanning for assets.
Checks to see if threads are still scanning for assets .
// wait for each scanner thread as each will release a permit // if did not acquire semaphore then not completed scanning within amount of time. // whether all scans completed successfully or not, the scanning operation is complete.