Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better way to screen out NativeThread objects? #54

Closed
jazzdelightsme opened this issue Nov 20, 2016 · 1 comment
Closed

Better way to screen out NativeThread objects? #54

jazzdelightsme opened this issue Nov 20, 2016 · 1 comment

Comments

@jazzdelightsme
Copy link
Member

The NativeThread class is just a stub (everything throws NotImplementedException).

When enumerating managed threads, I need to filter out these NativeThread objects, because they don't actually do anything but throw. Unfortunately, I don't see a good way to do it other than reflection:

    foreach( var dac in proc.ClrRuntimes )
    {
        var t = dac.Threads.Where( ( x ) => x.OSThreadId == Tid ).FirstOrDefault();
        if( (null != t) && !(t.GetType().Name.Contains( "NativeThread" )) )
            list.Add( t );
    }

What's the plan for this class--will it eventually be filled in? Or if they are only ever meant to be a placeholder, should there be a non-reflection way to recognize them?

@leculver
Copy link
Contributor

I've split the the .Net Native code into its own library (no NuGet package for it yet). This should fix the underlying issue you are having here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants