author | Francesco Abbate <francesco.bbt@gmail.com> | 2012年03月29日 17:23:35 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2012年04月01日 22:57:19 +0200 |
commit | 5c80bf0af85627c0e62d0f097e9ed6679f6bed73 (patch) | |
tree | 53c88940049bef966c8994cf59f831c26061a8c2 /lua-gsl.h | |
parent | e255825367665691584ae44755df5f2882a25c66 (diff) | |
download | gsl-shell-5c80bf0af85627c0e62d0f097e9ed6679f6bed73.tar.gz |
-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 |