1
0

Thread.Stub.cs 763 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
  2. #if NO_THREAD
  3. using System;
  4. using System.Threading;
  5. namespace System.Reactive.Concurrency
  6. {
  7. class Thread
  8. {
  9. private readonly ThreadStart _start;
  10. public Thread(ThreadStart start)
  11. {
  12. _start = start;
  13. }
  14. public string Name { get; set; }
  15. public bool IsBackground { get; set; }
  16. public void Start()
  17. {
  18. System.Threading.Tasks.Task.Factory.StartNew(Run, System.Threading.Tasks.TaskCreationOptions.LongRunning);
  19. }
  20. private void Run()
  21. {
  22. _start();
  23. }
  24. }
  25. delegate void ThreadStart();
  26. }
  27. #endif