1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 12:20:26 +02:00

* threads.h (scm_current_thread, scm_all_threads): New prototypes.

* threads.c (scm_current_thread, scm_all_threads): Register as
primitives.
This commit is contained in:
Marius Vollmer 2002-10-03 22:48:15 +00:00
parent 8e583c6e1b
commit f7eca35dfe
2 changed files with 11 additions and 2 deletions

View file

@ -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.

View file

@ -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