mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Remove GC-related fields from `scm_i_thread'.
* libguile/gc.h (scm_i_freelist, scm_i_freelist2): Remove declarations. * libguile/threads.c (resume): Don't use `t->clear_freelists_p' and `scm_i_freelist{,2}'. (scm_enter_guile, scm_leave_guile, guilify_self_1): Don't use the `heap_mutex' and other fields removed from `scm_i_thread'. (scm_i_freelist, scm_i_freelist2): Remove. * libguile/threads.h (scm_i_thread)[heap_mutex, freelist, freelist2, clear_freelists_p]: Remove.
This commit is contained in:
parent
43adae308c
commit
f5cc9619df
3 changed files with 0 additions and 32 deletions
|
@ -165,8 +165,6 @@ SCM_API size_t scm_max_segment_size;
|
|||
|
||||
#define SCM_SET_FREELIST_LOC(key,ptr) scm_i_pthread_setspecific ((key), (ptr))
|
||||
#define SCM_FREELIST_LOC(key) ((SCM *) scm_i_pthread_getspecific (key))
|
||||
SCM_API scm_i_pthread_key_t scm_i_freelist;
|
||||
SCM_API scm_i_pthread_key_t scm_i_freelist2;
|
||||
SCM_API struct scm_t_cell_type_statistics scm_i_master_freelist;
|
||||
SCM_API struct scm_t_cell_type_statistics scm_i_master_freelist2;
|
||||
|
||||
|
|
|
@ -372,12 +372,6 @@ static void
|
|||
resume (scm_i_thread *t)
|
||||
{
|
||||
t->top = NULL;
|
||||
if (t->clear_freelists_p)
|
||||
{
|
||||
*SCM_FREELIST_LOC (scm_i_freelist) = SCM_EOL;
|
||||
*SCM_FREELIST_LOC (scm_i_freelist2) = SCM_EOL;
|
||||
t->clear_freelists_p = 0;
|
||||
}
|
||||
}
|
||||
|
||||
typedef void* scm_t_guile_ticket;
|
||||
|
@ -388,7 +382,6 @@ scm_enter_guile (scm_t_guile_ticket ticket)
|
|||
scm_i_thread *t = (scm_i_thread *)ticket;
|
||||
if (t)
|
||||
{
|
||||
scm_i_pthread_mutex_lock (&t->heap_mutex);
|
||||
resume (t);
|
||||
}
|
||||
}
|
||||
|
@ -410,7 +403,6 @@ static scm_t_guile_ticket
|
|||
scm_leave_guile ()
|
||||
{
|
||||
scm_i_thread *t = suspend ();
|
||||
scm_i_pthread_mutex_unlock (&t->heap_mutex);
|
||||
return (scm_t_guile_ticket) t;
|
||||
}
|
||||
|
||||
|
@ -464,24 +456,15 @@ guilify_self_1 (SCM_STACKITEM *base)
|
|||
t->sleep_fd = -1;
|
||||
/* XXX - check for errors. */
|
||||
pipe (t->sleep_pipe);
|
||||
scm_i_pthread_mutex_init (&t->heap_mutex, NULL);
|
||||
scm_i_pthread_mutex_init (&t->admin_mutex, NULL);
|
||||
t->clear_freelists_p = 0;
|
||||
t->gc_running_p = 0;
|
||||
t->current_mark_stack_ptr = NULL;
|
||||
t->current_mark_stack_limit = NULL;
|
||||
t->canceled = 0;
|
||||
t->exited = 0;
|
||||
|
||||
t->freelist = SCM_EOL;
|
||||
t->freelist2 = SCM_EOL;
|
||||
SCM_SET_FREELIST_LOC (scm_i_freelist, &t->freelist);
|
||||
SCM_SET_FREELIST_LOC (scm_i_freelist2, &t->freelist2);
|
||||
|
||||
scm_i_pthread_setspecific (scm_i_thread_key, t);
|
||||
|
||||
scm_i_pthread_mutex_lock (&t->heap_mutex);
|
||||
|
||||
scm_i_pthread_mutex_lock (&thread_admin_mutex);
|
||||
t->next_thread = all_threads;
|
||||
all_threads = t;
|
||||
|
@ -1901,7 +1884,6 @@ scm_dynwind_critical_section (SCM mutex)
|
|||
|
||||
/*** Initialization */
|
||||
|
||||
scm_i_pthread_key_t scm_i_freelist, scm_i_freelist2;
|
||||
scm_i_pthread_mutex_t scm_i_misc_mutex;
|
||||
|
||||
#if SCM_USE_PTHREAD_THREADS
|
||||
|
@ -1921,8 +1903,6 @@ scm_threads_prehistory (SCM_STACKITEM *base)
|
|||
scm_i_pthread_mutexattr_recursive);
|
||||
scm_i_pthread_mutex_init (&scm_i_misc_mutex, NULL);
|
||||
scm_i_pthread_cond_init (&wake_up_cond, NULL);
|
||||
scm_i_pthread_key_create (&scm_i_freelist, NULL);
|
||||
scm_i_pthread_key_create (&scm_i_freelist2, NULL);
|
||||
|
||||
guilify_self_1 (base);
|
||||
}
|
||||
|
|
|
@ -66,16 +66,6 @@ typedef struct scm_i_thread {
|
|||
scm_i_pthread_cond_t sleep_cond;
|
||||
int sleep_fd, sleep_pipe[2];
|
||||
|
||||
/* This mutex represents this threads right to access the heap.
|
||||
That right can temporarily be taken away by the GC.
|
||||
*/
|
||||
scm_i_pthread_mutex_t heap_mutex;
|
||||
|
||||
/* The freelists of this thread. Each thread has its own lists so
|
||||
that they can all allocate concurrently.
|
||||
*/
|
||||
SCM freelist, freelist2;
|
||||
int clear_freelists_p; /* set if GC was done while thread was asleep */
|
||||
int gc_running_p; /* non-zero while this thread does GC or a
|
||||
sweep. */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue