5 #include "shotgun/lib/machine.h"
8 Rubinius environment stores load paths,
9 platform configuration, list of spawned machines,
11 and synchronization mutex.
13 One environment is automatically created on
16 Each environment lives in it's own pthread
18 struct rubinius_environment
{
19 pthread_mutex_t mutex
;
20 struct hashtable
*machines
;
21 char *platform_config
;
29 struct hashtable
*messages
;
30 struct ev_loop
*sig_event_base
;
31 struct ev_signal sig_ev
;
34 typedef struct rubinius_environment
*environment
;
36 struct rubinius_global
{
41 environment
environment_new();
42 void environment_at_startup();
43 void environment_setup_thread(environment e
, machine m
);
44 environment
environment_current();
45 machine
environment_current_machine();
46 void environment_add_machine(environment e
, machine m
);
47 int environment_del_machine(environment e
, machine m
);
48 int environment_load_machine(environment e
, machine m
);
49 void environment_start_thread(environment e
, machine m
);
50 void environment_exit_machine();
51 int environment_join_machine(environment e
, int id
);
52 void environment_fork();
54 void environment_send_message(environment e
, int id
, OBJECT msg
);
55 OBJECT
environment_get_message(environment e
, int id
);