summaryrefslogtreecommitdiff
path: root/libguile/pthread-threads.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-03-25 13:01:51 +0100
committerAndy Wingo <wingo@pobox.com>2011-03-25 13:01:51 +0100
commit12c1d8616d8dfedcad65f34e3968f9544b629ae1 (patch)
tree7db72f78e6df7001d6294d62888527e9bf9675f5 /libguile/pthread-threads.h
parent2a6f90e52436afdbbcdcf99bfe8a5c24cefd9769 (diff)
downloadguile-12c1d8616d8dfedcad65f34e3968f9544b629ae1.tar.gz
threading / with_guile refactor to use more GC_stack_base
* libguile/init.h: * libguile/init.c (scm_i_init_guile): Change arg to this internal function from SCM_STACKITEM* to void*. Actually it's a struct GC_stack_base*. * libguile/bdw-gc.h: Don't do pthread redirects, because we don't want to affect applications' pthread_* bindings. * libguile/pthread-threads.h (scm_i_pthread_create) (scm_i_pthread_detach, scm_i_pthread_exit, scm_i_pthread_cancel) (scm_i_pthread_sigmask): Do pthread redirects here, in this internal header. * libguile/threads.h: Remove declaration of internal scm_i_with_guile_and_parent. Remove declaration of undefined scm_threads_init_first_thread. Make declaration of internal scm_threads_prehistory actually internal, and take a void* (actually a struct GC_stack_base*). * libguile/threads.c (GC_get_stack_base): Implement a shim if this function is unavailable, and fold in the implementations of get_thread_stack_base. (GC_call_with_stack_base): Actually implement. (guilify_self_1): Take a GC_stack_base* as an arg. (scm_i_init_thread_for_guile): Likewise, and set up libgc for registration of other threads. (scm_init_guile): Use GC_get_stack_base instead of our own guesswork. (with_guile_and_parent, scm_i_with_guile_and_parent): Rework to trampoline through a GC_call_with_stack_base. (scm_threads_prehistory): Pass the "base" arg on to guilify_self_1.
Diffstat (limited to 'libguile/pthread-threads.h')
-rw-r--r--libguile/pthread-threads.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/libguile/pthread-threads.h b/libguile/pthread-threads.h
index ca72f1674..c180af252 100644
--- a/libguile/pthread-threads.h
+++ b/libguile/pthread-threads.h
@@ -3,7 +3,7 @@
#ifndef SCM_PTHREADS_THREADS_H
#define SCM_PTHREADS_THREADS_H
-/* Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2005, 2006, 2011 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -29,24 +29,24 @@
#include <pthread.h>
#include <sched.h>
-/* `libgc' intercepts pthread calls by defining wrapping macros. */
+/* `libgc' defines wrapper procedures for pthread calls. */
#include "libguile/bdw-gc.h"
/* Threads
*/
#define scm_i_pthread_t pthread_t
#define scm_i_pthread_self pthread_self
-#define scm_i_pthread_create pthread_create
-#define scm_i_pthread_detach pthread_detach
-#define scm_i_pthread_exit pthread_exit
-#define scm_i_pthread_cancel pthread_cancel
+#define scm_i_pthread_create GC_pthread_create
+#define scm_i_pthread_detach GC_pthread_detach
+#define scm_i_pthread_exit GC_pthread_exit
+#define scm_i_pthread_cancel GC_pthread_cancel
#define scm_i_pthread_cleanup_push pthread_cleanup_push
#define scm_i_pthread_cleanup_pop pthread_cleanup_pop
#define scm_i_sched_yield sched_yield
/* Signals
*/
-#define scm_i_pthread_sigmask pthread_sigmask
+#define scm_i_pthread_sigmask GC_pthread_sigmask
/* Mutexes
*/