+2007-08-10 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * Thread.cs: Throw ThreadStateException when retrieving ApartmentState
+ or IsBackground if thread is stopped. Fixes bug #81658.
+
2007-08-08 Zoltan Varga <vargaz@gmail.com>
* Thread.cs: Add a fixme.
#endif
public ApartmentState ApartmentState {
get {
+ if ((ThreadState & ThreadState.Stopped) != 0)
+ throw new ThreadStateException ("Thread is dead; state can not be accessed.");
+
return (ApartmentState)apartment_state;
}
public bool IsBackground {
get {
- return (GetState () & ThreadState.Background) != 0;
+ ThreadState thread_state = GetState ();
+ if ((thread_state & ThreadState.Stopped) != 0)
+ throw new ThreadStateException ("Thread is dead; state can not be accessed.");
+
+ return (thread_state & ThreadState.Background) != 0;
}
set {
+2007-08-10 Gert Driesen <drieseng@users.sourceforge.net>
+
+ * ThreadTest.cs: Enabled test for bug #81658.
+
2007-07-22 Gert Driesen <drieseng@users.sourceforge.net>
* AutoResetEventTest.cs: Added test for verifying effect of assigning