public static bool QueueUserWorkItem <TState>(System.Action <TState> callBack, TState state, bool preferLocal) { java.lang.Runnable.Delegate runnable = () => callBack(state); JavaThreadPool.execute(runnable.AsInterface()); return(true); }
public static bool QueueUserWorkItem(System.Threading.WaitCallback callBack, object state) { if (callBack == null) { throw new System.ArgumentNullException(); } java.lang.Runnable.Delegate runnable = () => callBack(state); JavaThreadPool.execute(runnable.AsInterface()); return(true); }
public static void UnsafeQueueCustomWorkItem(IThreadPoolWorkItem workItem, bool forceGlobal) { java.lang.Runnable.Delegate runnable = () => workItem.ExecuteWorkItem(); JavaThreadPool.execute(runnable.AsInterface()); }
// helper method for Timer::run, because TimerCallback is not castable to WaitCallback public static void QueueTimerWorkItem(TimerCallback func, object data) { JavaThreadPool.execute(((java.lang.Runnable.Delegate)(() => func(data))).AsInterface()); }