-rw-r--r-- | lua-gsl.h | 17 |
@@ -6,20 +6,21 @@ #include "defs.h" __BEGIN_DECLS + #include <lua.h> -extern pthread_mutex_t gsl_shell_mutex[1]; -extern pthread_mutex_t gsl_shell_shutdown_mutex[1]; -extern volatile int gsl_shell_shutting_down; +struct gsl_shell_state { + lua_State *L; + pthread_mutex_t exec_mutex; + pthread_mutex_t shutdown_mutex; + int is_shutting_down; +}; -extern void gsl_shell_init (); -extern void gsl_shell_close (); +extern void gsl_shell_open (struct gsl_shell_state *gs); +extern void gsl_shell_close (struct gsl_shell_state *gs); extern int luaopen_gsl (lua_State *L); __END_DECLS -#define GSL_SHELL_LOCK() pthread_mutex_lock (gsl_shell_mutex) -#define GSL_SHELL_UNLOCK() pthread_mutex_unlock (gsl_shell_mutex) - #endif |