Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Re: 'ThreadState' is giving problem ?

Thread Tools

Re: 'ThreadState' is giving problem ?

Gaurav Khanna [.NET MVP]
Posts: n/a

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.

Gaurav Khanna

Microsoft MVP - .NET, MCSE Windows 2000/NT4, MCP+I
WinToolZone - Spelunking Microsoft Technologies
OpSupport - Spelunking Rotor

"Srinu" <(E-Mail Removed)> wrote in message
news:ef$(E-Mail Removed)...
> 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

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
The giving that keeps on giving sixteenmillion C Programming 0 11-19-2007 10:59 PM
Request.Servervariables("Logon_User") giving problem Amitava Bardhan ASP .Net 1 05-17-2005 02:58 PM
Inner class involving templates giving problem darkstorm C++ 3 05-02-2005 03:30 PM
Server.Tranfer giving Thread abort problem =?Utf-8?B?c3Jpa2lydGk=?= ASP .Net 3 05-20-2004 08:21 AM
Struts <logic:iterate> giving problem. Senthil Java 0 05-04-2004 11:18 PM