From 6f1382058bac526a28832462998a74e2c9cbfaa6 Mon Sep 17 00:00:00 2001
From: Martin Stjernholm <mast@lysator.liu.se>
Date: Fri, 7 Apr 2006 15:46:01 +1000
Subject: [PATCH] Make the constant symbols for the values returned by
 Thread.status visible in the Threads module and documented them somewhat.

Rev: lib/modules/Thread.pmod:1.43
Rev: src/threads.c:1.249
---
 lib/modules/Thread.pmod |  3 +++
 src/threads.c           | 11 ++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/lib/modules/Thread.pmod b/lib/modules/Thread.pmod
index abcda2b821..e47f0650e0 100644
--- a/lib/modules/Thread.pmod
+++ b/lib/modules/Thread.pmod
@@ -55,6 +55,9 @@ optional constant this_thread = predef::this_thread;
 
 optional constant all_threads = predef::all_threads;
 
+constant THREAD_NOT_STARTED = __builtin.THREAD_NOT_STARTED;
+constant THREAD_RUNNING = __builtin.THREAD_RUNNING;
+constant THREAD_EXITED = __builtin.THREAD_EXITED;
 
 
 //! @[Fifo] implements a fixed length first-in, first-out queue.
diff --git a/src/threads.c b/src/threads.c
index aa0552b77e..f75d841f81 100644
--- a/src/threads.c
+++ b/src/threads.c
@@ -2,7 +2,7 @@
 || This file is part of Pike. For copyright information see COPYRIGHT.
 || Pike is distributed under GPL, LGPL and MPL. See the file COPYING
 || for more information.
-|| $Id: threads.c,v 1.248 2006/01/30 10:03:21 grubba Exp $
+|| $Id: threads.c,v 1.249 2006/04/07 05:46:01 mast Exp $
 */
 
 #ifndef CONFIGURE_TEST
@@ -1694,6 +1694,15 @@ void f_thread_backtrace(INT32 args)
 }
 
 /*! @decl int status()
+ *!
+ *! Returns the status of the thread.
+ *!
+ *! @returns
+ *!   @int
+ *!     @value @[Thread.THREAD_NOT_STARTED]
+ *!     @value @[Thread.THREAD_RUNNING]
+ *!     @value @[Thread.THREAD_EXITED]
+ *!   @endint
  */
 void f_thread_id_status(INT32 args)
 {
-- 
GitLab