Re: 'ThreadState' is giving 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:ef$...
    > 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 Ennumeration Problem ?

    Gaurav Khanna [.NET MVP], Jul 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,533
    Gaurav Khanna [.NET MVP]
    Jul 25, 2003
  2. =?Utf-8?B?c3Jpa2lydGk=?=

    Server.Tranfer giving Thread abort problem

    =?Utf-8?B?c3Jpa2lydGk=?=, May 20, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    3,792
    =?Utf-8?B?c3Jpa2lydGk=?=
    May 20, 2004
  3. Amitava Bardhan
    Replies:
    1
    Views:
    2,935
    Marina
    May 17, 2005
  4. Senthil
    Replies:
    0
    Views:
    416
    Senthil
    May 5, 2004
  5. sixteenmillion

    The giving that keeps on giving

    sixteenmillion, Nov 19, 2007, in forum: C Programming
    Replies:
    0
    Views:
    457
    sixteenmillion
    Nov 19, 2007
Loading...

Share This Page