mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
refactor do_thread_exit cleanup handler invocation
* libguile/threads.c (do_thread_exit): Redo cleanup handler call so as not to shove a SCM into a pointer.
This commit is contained in:
parent
4d40bea6c2
commit
2002f1f847
1 changed files with 8 additions and 1 deletions
|
@ -607,6 +607,13 @@ typedef struct {
|
|||
#define SCM_MUTEXP(x) SCM_SMOB_PREDICATE (scm_tc16_mutex, x)
|
||||
#define SCM_MUTEX_DATA(x) ((fat_mutex *) SCM_SMOB_DATA (x))
|
||||
|
||||
static SCM
|
||||
call_cleanup (void *data)
|
||||
{
|
||||
SCM *proc_p = data;
|
||||
return scm_call_0 (*proc_p);
|
||||
}
|
||||
|
||||
/* Perform thread tear-down, in guile mode.
|
||||
*/
|
||||
static void *
|
||||
|
@ -624,7 +631,7 @@ do_thread_exit (void *v)
|
|||
|
||||
t->cleanup_handler = SCM_BOOL_F;
|
||||
t->result = scm_internal_catch (SCM_BOOL_T,
|
||||
(scm_t_catch_body) scm_call_0, ptr,
|
||||
call_cleanup, &ptr,
|
||||
scm_handle_by_message_noexit, NULL);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue