当前位置: 首页>>代码示例>>C#>>正文


C# Runnable类代码示例

本文整理汇总了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;
		}
开发者ID:renaud91,项目名称:n-metadata-extractor,代码行数:7,代码来源:ThreadFactory.cs

示例2: post

 //================================================================
 //Getter and Setter
 //================================================================
 //================================================================
 //Methodes
 //================================================================
 public void post(Runnable run)
 {
     if (run != null)
     {
         runnables.Add(run);
     }
 }
开发者ID:backviet01,项目名称:winengine,代码行数:13,代码来源:RunnableUpdateHandler.cs

示例3: NewThread

			public Sharpen.Thread NewThread(Runnable taskBody)
			{
				Sharpen.Thread thr = this.baseFactory.NewThread(taskBody);
				thr.SetName("JGit-AlarmQueue");
				thr.SetDaemon(true);
				return thr;
			}
开发者ID:LunarLanding,项目名称:ngit,代码行数:7,代码来源:BatchingProgressMonitor.cs

示例4: NewThread

 public SharpenThread NewThread (Runnable r)
 {
     SharpenThread t = new SharpenThread (r);
     t.SetDaemon (true);
     t.Start ();
     return t;
 }
开发者ID:DotNetEra,项目名称:couchbase-lite-net,代码行数:7,代码来源:ThreadFactory.cs

示例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;
        }
开发者ID:shayhatsor,项目名称:curator,代码行数:8,代码来源:CloseableScheduledExecutorService.cs

示例6: tryCatch

 public static Exception tryCatch(Runnable runnable) {
   try {
     runnable.run();
     return null;
   } catch (Exception exception) {
     return exception;
   }
 }
开发者ID:habibutsu,项目名称:scala-2.4.x,代码行数:8,代码来源:ExceptionHandling.cs

示例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);
			}
		}
开发者ID:martijn00,项目名称:XamarinMediaManager,代码行数:9,代码来源:VideoPlayerImplementation.cs

示例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;
 }
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:9,代码来源:ClassRoadie.cs

示例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--;
 }
开发者ID:costas-basdekis,项目名称:VersatileParsingLanguage,代码行数:9,代码来源:Compiler.cs

示例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);
 }
开发者ID:costas-basdekis,项目名称:VersatileParsingLanguage,代码行数:9,代码来源:Compiler.cs

示例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);
     }
 }
开发者ID:CristianCosta,项目名称:Kinect,代码行数:10,代码来源:FrameDispatcher.cs

示例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;
 }
开发者ID:JeffryGonzalez,项目名称:fitsharp,代码行数:10,代码来源:Runner.cs

示例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";
		}
开发者ID:Redth,项目名称:couchbase-lite-net,代码行数:10,代码来源:Thread.cs

示例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);
        }
开发者ID:shayhatsor,项目名称:curator,代码行数:10,代码来源:CloseableScheduledExecutorService.cs

示例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;
		}
开发者ID:hazzik,项目名称:Sharpen.Runtime,代码行数:10,代码来源:Thread.cs


注:本文中的Runnable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。