public void inFacadeThread(Runnable toRun) { if (facadeActor!=null) { if ( Thread.currentThread() != facadeActor.getCurrentDispatcher() ) { facadeActor.execute( toRun ); return; } } else { int debug = 1; } toRun.run(); }
public void inFacadeThread(Runnable toRun) { if (facadeActor!=null) { if ( Thread.currentThread() != facadeActor.getCurrentDispatcher() ) { facadeActor.execute( toRun ); return; } } else { int debug = 1; } toRun.run(); }
/** * Debug method. * can be called to check actor code is actually single threaded. * By using custom callbacks/other threading bugs accidental multi threading * can be detected that way. * */ protected final void checkThread() { if (getCurrentDispatcher() != null && getCurrentDispatcher() != Thread.currentThread()) { Log.Error(this,"UNEXPECTED MULTITHREADING"); throw new RuntimeException("Wrong Thread"); } else if ( getCurrentDispatcher() == null ){ Log.Error(this,"Not in Dispatcher Thread"); throw new RuntimeException("Not in Dispatcher Thread:"+Thread.currentThread().getName()); } }
/** * Debug method. * can be called to check actor code is actually single threaded. * By using custom callbacks/other threading bugs accidental multi threading * can be detected that way. * */ protected final void checkThread() { if (getCurrentDispatcher() != null && getCurrentDispatcher() != Thread.currentThread()) { Log.Error(this,"UNEXPECTED MULTITHREADING"); throw new RuntimeException("Wrong Thread"); } else if ( getCurrentDispatcher() == null ){ Log.Error(this,"Not in Dispatcher Thread"); throw new RuntimeException("Not in Dispatcher Thread:"+Thread.currentThread().getName()); } }