Code example for AtomicBoolean

Methods: set

0
    this.dbHelper = dbHelper;
    setName( "query-" + getName() );
  } 
   
  public void setDone() { 
    done.set( true );
  } 
   
  public void addToQueue( final Request request ) {
    try { 
      queue.put( request );
    } 
    catch ( InterruptedException ex ) {
      ListActivity.info( getName() + " interrupted" );
    } 
  } 
   
  public void run() { 
    while ( ! done.get() ) {
      try { 
        final Request request = queue.take();