From f7eca35dfe7461fe2a8eb9c6da18a0e921366db5 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 3 Oct 2002 22:48:15 +0000 Subject: [PATCH] * threads.h (scm_current_thread, scm_all_threads): New prototypes. * threads.c (scm_current_thread, scm_all_threads): Register as primitives. --- libguile/threads.c | 5 ++++- libguile/threads.h | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/libguile/threads.c b/libguile/threads.c index 9c984f4e7..e06d7402c 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -101,6 +101,9 @@ with-new-thread was evaluated, but not in the callers thread. All the evaluation rules for dynamic roots apply to threads. */ +SCM_REGISTER_PROC(s_current_thread, "current-thread", 0, 0, 0, scm_current_thread); +SCM_REGISTER_PROC(s_all_thread, "all-threads", 0, 0, 0, scm_all_threads); + SCM_REGISTER_PROC(s_join_thread, "join-thread", 1, 0, 0, scm_join_thread); /* Suspend execution of the calling thread until the target @var{thread} terminates, unless the target @var{thread} has already terminated. diff --git a/libguile/threads.h b/libguile/threads.h index cbd60f075..e4106b2b1 100644 --- a/libguile/threads.h +++ b/libguile/threads.h @@ -3,7 +3,7 @@ #ifndef SCM_THREADS_H #define SCM_THREADS_H -/* Copyright (C) 1996,1997,1998,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1996,1997,1998,2000,2001, 2002 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,6 +49,7 @@ #include "libguile/__scm.h" #include "libguile/procs.h" #include "libguile/throw.h" +#include "libguile/root.h" @@ -100,6 +101,11 @@ SCM_API SCM scm_make_condition_variable (void); SCM_API SCM scm_wait_condition_variable (SCM cond, SCM mutex); SCM_API SCM scm_signal_condition_variable (SCM cond); +SCM_API SCM scm_current_thread (void); +SCM_API SCM scm_all_threads (void); + +SCM_API scm_root_state *scm_i_thread_root (SCM thread); + #ifdef USE_COOP_THREADS #include "libguile/coop-defs.h" #endif -- 2.20.1