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

ClassConstructorRunner.NonPortable.cs « CompilerServices « Runtime « System « src « System.Private.CoreLib « src - github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4c309ca3479e86ac673d78e6b7f35c920dc2652d (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
35
36
37
38
39
40
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Threading;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace System.Runtime.CompilerServices
{
    //=========================================================================================================
    // This is the non-portable part of ClassConstructorRunner. It lives in a seaparate .cs file to make
    // it easier to include the main ClassConstructorRunner source into a desktop project for testing.
    //=========================================================================================================

    [McgIntrinsics]
    internal static partial class ClassConstructorRunner
    {
        //=========================================================================================================
        // Intrinsic to call the cctor given a pointer to the code (this method's body is ignored and replaced
        // with a calli during compilation). The transform doesn't handle non-generic versions yet (i.e.
        // functions that are void).
        //=========================================================================================================
        private static T Call<T>(System.IntPtr pfn)
        {
            throw NotImplemented.ByDesign;
        }

        private static int CurrentManagedThreadId
        {
            get
            {
                return ManagedThreadId.Current;
            }
        }

        private const int ManagedThreadIdNone = ManagedThreadId.IdNone;
    }
}