Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Thread.Stub.cs « Concurrency « Reactive « System.Reactive.PlatformServices « Source « NET « Rx - github.com/mono/rx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 691365b8478b290a899c8c7420d3938d0de7a736 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

#if NO_THREAD
using System;
using System.Threading;

namespace System.Reactive.Concurrency
{
    class Thread
    {
        private readonly ThreadStart _start;

        public Thread(ThreadStart start)
        {
            _start = start;
        }

        public string Name { get; set; }
        public bool IsBackground { get; set; }

        public void Start()
        {
            System.Threading.Tasks.Task.Factory.StartNew(Run, System.Threading.Tasks.TaskCreationOptions.LongRunning);
        }

        private void Run()
        {
            _start();
        }
    }

    delegate void ThreadStart();
}
#endif