Index: NSThread.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/base/Source/NSThread.m,v
retrieving revision 1.72
diff -u -d -b -w -r1.72 NSThread.m
--- NSThread.m	31 Jul 2003 23:49:31 -0000	1.72
+++ NSThread.m	29 Sep 2003 17:43:13 -0000
@@ -246,9 +246,23 @@
       t = (NSThread*)objc_thread_get_data();
       if (t == nil)
 	{
+	  /*
+           * If thread is nil, we have a thread which has not been
+	   * registered with GNUstep, for example a timer thread from
+	   * Windows. So we register it here and then re-retrieve.
+           */
+	  GSRegisterCurrentThread();
+	  t = (NSThread*)objc_thread_get_data();
+	  /*
+           * If that didn't work, I dunno, give up, go home to Mum.
+           */
+	  if (t == nil)
+	    {
 	  fprintf(stderr, "ALERT ... GSCurrentThread() ... the "
-	    "objc_thread_get_data() call returned nil!");
+		      "objc_thread_get_data() call returned nil after "
+                      "trying to register it!");
 	  fflush(stderr);	// Needed for windoze
+	    }
 	}
     }
   return t;
