Commit 7f2b0662 authored by Erick's avatar Erick

If we cannot associate a VM to the current thread, use the VM of the

primordial thread. This permits to use libraries that have their own
threads and need to call Scheme.
parent c879a3b4
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@essi.fr]
* Creation date: 23-Jan-2006 12:14 (eg)
* Last file update: 4-Nov-2006 12:44 (eg)
* Last file update: 3-Jan-2009 22:28 (eg)
*/
......@@ -54,7 +54,9 @@ static void initialize_vm_key(void)
vm_thread_t *STk_get_current_vm(void)
{
return (vm_thread_t *) pthread_getspecific(vm_key);
vm_thread_t *vm = pthread_getspecific(vm_key);
return vm? vm : THREAD_VM(STk_primordial_thread);
}
......
/*
* v m . c -- The STklos Virtual Machine
*
* Copyright 2000-2008 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
* Copyright 2000-2009 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
*
*
* This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [eg@unice.fr]
* Creation date: 1-Mar-2000 19:51 (eg)
* Last file update: 1-May-2008 18:43 (eg)
* Last file update: 3-Jan-2009 22:22 (eg)
*/
// INLINER values
......@@ -502,7 +502,7 @@ DEFINE_PRIMITIVE("apply", scheme_apply, apply, (void))
* an "excv" or an "execl" function. If nargs is > 0 it is as a Unix "execl"
* function:
* STk_C_apply(STk_cons, 2, MAKE_INT(1), MAKE_INT(2)) => (1 . 2)
* If nargs is < 0, we have something similar to an "execv function
* If nargs is < 0, we have something similar to an "execv" function
* STk_C_apply(...STk_intern("cons")..., -2, Argv)
* where Argv[0] == MAKE_INT(1) and Argv[1] == MAKE_INT(2) ==> (1 . 2)
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment