Tabnine Logo
ThreadLockServiceImpl.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.kie.commons.io.impl.lock.ThreadLockServiceImpl
constructor

Best Java code snippets using org.kie.commons.io.impl.lock.ThreadLockServiceImpl.<init> (Showing top 6 results out of 315)

origin: org.kie.commons/kie-commons-io

public AbstractIOService() {
  lockService = new ThreadLockServiceImpl();
  ioWatchService = null;
}
origin: org.kie.commons/kie-commons-io

public AbstractIOService( final IOWatchService watchService ) {
  lockService = new ThreadLockServiceImpl();
  ioWatchService = watchService;
}
origin: org.kie.commons/kie-commons-io

@Test
public void testLock() {
  final ThreadLockServiceImpl lockService = new ThreadLockServiceImpl();
  lockService.lock();
  lockService.unlock();
}
origin: org.kie.commons/kie-commons-io

@Test
public void testDoubleLock() {
  final ThreadLockServiceImpl lockService = new ThreadLockServiceImpl();
  lockService.lock();
  lockService.lock();
  lockService.unlock();
  lockService.unlock();
}
origin: org.kie.commons/kie-commons-io

  @Test
  public void testOnThreads() throws InterruptedException {
    for ( int i = 0; i < 100; i++ ) {
      final ThreadLockServiceImpl lockService = new ThreadLockServiceImpl();
      final boolean[] vals = new boolean[]{ false };
      lockService.lock();
      Thread thread = new Thread( new Runnable() {
        @Override
        public void run() {
          lockService.lock();
          vals[ 0 ] = true;
        }
      } );
      thread.setName( "temp" );
      assertThat( vals[ 0 ] ).isEqualTo( false );
      thread.start();
      assertThat( vals[ 0 ] ).isEqualTo( false );
      lockService.unlock();
      Thread.sleep( 120 );
      assertThat( vals[ 0 ] ).isEqualTo( true );
    }
  }
}
origin: org.kie.commons/kie-commons-io

@Test(expected = IllegalMonitorStateException.class)
public void testUnlock() {
  final ThreadLockServiceImpl lockService = new ThreadLockServiceImpl();
  lockService.lock();
  lockService.lock();
  lockService.unlock();
  lockService.unlock();
  lockService.unlock();
}
org.kie.commons.io.impl.lockThreadLockServiceImpl<init>

Popular methods of ThreadLockServiceImpl

  • lock
  • unlock

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • JLabel (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Best IntelliJ plugins
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