src/slides/o4_synchronization/AtomicOneValueBuffer.java
public V take()
  {
    V value = null;
    
    do
    {
      value = buffer.getReference();
    }while( !buffer.compareAndSet(value, null, true, false) );
    
    return value;
  }
// the value can also be null
the value can also be null
the value can also be null
public V take()
  {
    V value = null;
    do
    {
      value = buffer.getReference();
    }while( !buffer.compareAndSet(value, null, true, false) );
    return value;
  }
public V take ( ) { V value = null ; do { value = buffer . getReference ( ) ; } while ( ! buffer . compareAndSet ( value , null , true , false ) ) ; return value ; }
the value can also be null
the value can also be null