diff options
author | Andy Wingo <wingo@pobox.com> | 2016-11-13 15:08:45 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-11-13 15:56:21 +0100 |
commit | 6bb51193df3620d962df87caf8cfbf6a4256a540 (patch) | |
tree | 12e1a47062da6c71670d995de1530541fe3a7d64 /libguile/async.c | |
parent | 1ed9dea34aa8cb0cbae17200c31d1ac91a6a01de (diff) | |
download | guile-6bb51193df3620d962df87caf8cfbf6a4256a540.tar.gz |
Refactor GC implications of thread sleep
* libguile/async.c (struct scm_thread_wake_data): Move definition here.
(scm_i_setup_sleep): Remove "sleep_object". Caller now responsible
for scm_remember_upto_here_1 as appropriate.
(scm_system_async_mark_for_thread): Remove scm_remember_upto_here_1
call.
* libguile/async.h (scm_i_setup_sleep): Adapt prototype.
* libguile/threads.h (struct scm_thread_wake_data): Remove definition.
* libguile/threads.c (block_self): Remove sleep_object argument.
(scm_join_thread_timed, scm_timed_lock_mutex)
(scm_timed_wait_condition_variable, scm_std_select): Adapt.
Diffstat (limited to 'libguile/async.c')
-rw-r--r-- | libguile/async.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libguile/async.c b/libguile/async.c index b4a2c2ad2..174a87afb 100644 --- a/libguile/async.c +++ b/libguile/async.c @@ -75,15 +75,19 @@ scm_async_tick (void) } } +struct scm_thread_wake_data { + scm_i_pthread_mutex_t *mutex; + int fd; +}; + int scm_i_setup_sleep (scm_i_thread *t, - SCM sleep_object, scm_i_pthread_mutex_t *sleep_mutex, + scm_i_pthread_mutex_t *sleep_mutex, int sleep_fd) { struct scm_thread_wake_data *wake; wake = scm_gc_typed_calloc (struct scm_thread_wake_data); - wake->object = sleep_object; wake->mutex = sleep_mutex; wake->fd = sleep_fd; @@ -148,10 +152,6 @@ SCM_DEFINE (scm_system_async_mark_for_thread, "system-async-mark", 1, 1, 0, scm_i_pthread_cond_signal (&t->sleep_cond); scm_i_pthread_mutex_unlock (wake->mutex); - /* This is needed to protect wake->mutex. - */ - scm_remember_upto_here_1 (wake->object); - if (wake->fd >= 0) { char dummy = 0; |