本文整理汇总了C#中Runnable类的典型用法代码示例。如果您正苦于以下问题:C# Runnable类的具体用法?C# Runnable怎么用?C# Runnable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Runnable类属于命名空间,在下文中一共展示了Runnable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NewThread
public Thread NewThread (Runnable r)
{
Thread t = new Thread (r);
t.SetDaemon (true);
t.Start ();
return t;
}
示例2: post
//================================================================
//Getter and Setter
//================================================================
//================================================================
//Methodes
//================================================================
public void post(Runnable run)
{
if (run != null)
{
runnables.Add(run);
}
}
示例3: NewThread
public Sharpen.Thread NewThread(Runnable taskBody)
{
Sharpen.Thread thr = this.baseFactory.NewThread(taskBody);
thr.SetName("JGit-AlarmQueue");
thr.SetDaemon(true);
return thr;
}
示例4: NewThread
public SharpenThread NewThread (Runnable r)
{
SharpenThread t = new SharpenThread (r);
t.SetDaemon (true);
t.Start ();
return t;
}
示例5: schedule
private schedule(Runnable task, long delay, TimeUnit unit)
{
Preconditions.checkState(isOpen.get(), "CloseableExecutorService is closed");
InternalFutureTask<void> futureTask = new InternalFutureTask<void>(new FutureTask<void>(task, null));
scheduledExecutorService.schedule(futureTask, delay, unit);
return futureTask;
}
示例6: tryCatch
public static Exception tryCatch(Runnable runnable) {
try {
runnable.run();
return null;
} catch (Exception exception) {
return exception;
}
}
示例7: StartPlayingHandler
private void StartPlayingHandler()
{
var handler = new Handler();
var runnable = new Runnable(() => { handler.Post(OnPlaying); });
if (!_executorService.IsShutdown)
{
_scheduledFuture = _executorService.ScheduleAtFixedRate(runnable, 100, 1000, TimeUnit.Milliseconds);
}
}
示例8: ClassRoadie
public ClassRoadie(RunNotifier notifier, TestClass testClass, Description description, Runnable runnable)
{
base.\u002Ector();
ClassRoadie classRoadie = this;
this.fNotifier = notifier;
this.fTestClass = testClass;
this.fDescription = description;
this.fRunnable = runnable;
}
示例9: RemoveItem
public void RemoveItem(Runnable Item)
{
for (int i = Item.ExecutionIndex; i < (Count - 1); i++)
{
Items[i] = Items[i + 1];
Items[i].ExecutionIndex = i;
}
Count--;
}
示例10: AddItem
public void AddItem(Runnable Item)
{
if ((Items.Length - Count) < 10)
IncreaseItemsSize();
var index = ++Count - 1;
Items[index] = Item;
Items[index].ExecutionIndex = index;
Compiler.OutItem(Item, this);
}
示例11: enqueueFrame
public static void enqueueFrame(Runnable frame)
{
lock(frameQueue){
if (frameQueue.Count > MAX_BUFFER){
frameQueue.Dequeue();
}
frameQueue.Enqueue(frame);
Debug.Log("largo de la cola de los frames = " + frameQueue.Count);
}
}
示例12: Execute
public int Execute()
{
string[] tokens = configuration.GetItem<Settings>().Runner.Split(',');
if (tokens.Length > 1) {
configuration.GetItem<ApplicationUnderTest>().AddAssembly(tokens[1]);
}
Runnable = new BasicProcessor().Create(tokens[0]).GetValue<Runnable>();
ExecuteInApartment();
return result;
}
示例13: Thread
Thread (Runnable runnable, ThreadGroup grp, string name)
{
cancelTokenSource = new CancellationTokenSource ();
task = new Task (InternalRun, cancelTokenSource.Token, TaskCreationOptions.LongRunning);
Runnable = runnable ?? this;
tgroup = grp ?? defaultGroup;
tgroup.Add (this);
Name = name ?? "Unknown";
}
示例14: scheduleWithFixedDelay
private scheduleWithFixedDelay(Runnable task, long initialDelay, long delay, TimeUnit unit)
{
Preconditions.checkState(isOpen.get(), "CloseableExecutorService is closed");
//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
//ORIGINAL LINE: java.util.concurrent.ScheduledFuture<?> scheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(task, initialDelay, delay, unit);
ScheduledFuture < ? >
scheduledFuture = scheduledExecutorService.scheduleWithFixedDelay(task, initialDelay, delay, unit);
return new InternalScheduledFutureTask(this, scheduledFuture);
}
示例15: Thread
Thread (Runnable runnable, ThreadGroup grp, string name)
{
thread = new System.Threading.Thread (new ThreadStart (InternalRun));
this.runnable = runnable ?? this;
tgroup = grp ?? defaultGroup;
tgroup.Add (this);
if (name != null)
thread.Name = name;
}