public void callSerially(Runnable r){
  if (codenameOneRunning) {
synchronized (lock) {
      pendingSerialCalls.add(r);
      lock.notifyAll();
    }
  }
 else {
    r.run();
  }
}

public void callSerially ( Runnable r ) { if ( codenameOneRunning ) { synchronized ( lock ) { pendingSerialCalls . add ( r ) ; lock . notifyAll ( ) ; } } else { r . run ( ) ; } }
causes the runnable to be invoked on the event dispatch thread . this method returns immediately and will not wait for the serial call to occur
