###@###.### (MR DUANE E TIEMANN)
Win32 only: Thread.isAlive() does not return boolean true, it returns a non-falsep value.
Therefore Thread.isAlive() == true always returns false.
Steps to reproduce:
Compile and run the attached code.
import java.io.*;
public class ThreadAliveTest
{
public static void main(String args[])
{
task theTask = new task();
theTask.start();
boolean result;
result = theTask.isAlive();
System.out.println("result is supposedly " + result);
if (result == false)
System.out.println("result is false");
else
System.out.println("result is not false");
if (result == true)
System.out.println("result is true");
else
System.out.println("result is not true");
if (result)
System.out.println("result is close enough to true");
else
System.out.println("result is not close enough to true");
theTask.stop();
try
{
theTask.join();
}
catch (InterruptedException e) {}
}
}
class task extends Thread
{
public void run()
{
while (true);
}
}
Win32 only: Thread.isAlive() does not return boolean true, it returns a non-falsep value.
Therefore Thread.isAlive() == true always returns false.
Steps to reproduce:
Compile and run the attached code.
import java.io.*;
public class ThreadAliveTest
{
public static void main(String args[])
{
task theTask = new task();
theTask.start();
boolean result;
result = theTask.isAlive();
System.out.println("result is supposedly " + result);
if (result == false)
System.out.println("result is false");
else
System.out.println("result is not false");
if (result == true)
System.out.println("result is true");
else
System.out.println("result is not true");
if (result)
System.out.println("result is close enough to true");
else
System.out.println("result is not close enough to true");
theTask.stop();
try
{
theTask.join();
}
catch (InterruptedException e) {}
}
}
class task extends Thread
{
public void run()
{
while (true);
}
}