Re: ThreadState Ennumeration Problem ?

Discussion in 'ASP .Net' started by Gaurav Khanna [.NET MVP], Jul 25, 2003.

  1. Hi!

    The .NET FCL has two entities that go by the name of ThreadState. The first
    is the ThreadState property of the ProcessThread class and the Thread class.
    Both are used to determine the current status of the thread, as you have
    tried to use in your code below.

    The second is the ThreadState enumeration that defines the various states of
    the thread. Modify your code to:

    bool result = ((aThread.ThreadState &
    System.Threading.ThreadState.Unstarted) !=0 && (aThread.ThreadState &
    System.Threading.ThreadState.Stopped) != 0);

    and the ambiguous nature will be taken care of.

    Regards,
    Gaurav Khanna


    --
    ----------------------------------------------------------------------------
    ----------
    Microsoft MVP - .NET, MCSE Windows 2000/NT4, MCP+I
    WinToolZone - Spelunking Microsoft Technologies
    http://www.wintoolzone.com/
    OpSupport - Spelunking Rotor
    http://opsupport.sscli.net/
    ----------------------------------------------------------------------------
    ----------

    "Srinu" <> wrote in message
    news:...
    > Hi,
    >
    > I was trying to find the current state of a thread ( aThread). I was
    > executing the following code.
    >
    >
    > bool result = ((aThread.ThreadState & ThreadState.Unstarted) != 0
    > && (aThread.ThreadState & ThreadState.Stopped) != 0);
    >
    >
    > while compiling, I got he following error message
    >
    >
    > 'ThreadState' is an ambiguous reference
    >
    >
    > Can somebody help me in this issue ?
    >
    > Srinu
    >
    >
    Gaurav Khanna [.NET MVP], Jul 25, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gaurav Khanna [.NET MVP]

    Re: 'ThreadState' is giving problem ?

    Gaurav Khanna [.NET MVP], Jul 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,109
    Gaurav Khanna [.NET MVP]
    Jul 25, 2003
  2. Andreas Suurkuusk
    Replies:
    0
    Views:
    3,968
    Andreas Suurkuusk
    Jul 27, 2003
  3. Ted Miller
    Replies:
    0
    Views:
    5,145
    Ted Miller
    Sep 13, 2003
  4. Merek
    Replies:
    0
    Views:
    1,956
    Merek
    Dec 3, 2003
  5. Mike

    Problem problem problem :( Need Help

    Mike, May 7, 2004, in forum: ASP General
    Replies:
    2
    Views:
    543
    Bullschmidt
    May 11, 2004
Loading...

Share This Page