mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +00:00
af7bd80430
This change introduces a new deadlock detector for Cosmo's POSIX threads implementation. Error check mutexes will now track a DAG of nested locks and report EDEADLK when a deadlock is theoretically possible. These will occur rarely, but it's important for production hardening your code. You don't even need to change your mutexes to use the POSIX error check mode because `cosmocc -mdbg` will enable error checking on mutexes by default globally. When cycles are found, an error message showing your demangled symbols describing the strongly connected component are printed and then the SIGTRAP is raised, which means you'll also get a backtrace if you're using ShowCrashReports() too. This new error checker is so low-level and so pure that it's able to verify the relationships of every libc runtime lock, including those locks upon which the mutex implementation depends.
28 lines
979 B
C
28 lines
979 B
C
#ifndef COSMOPOLITAN_THIRD_PARTY_LUA_LREPL_H_
|
|
#define COSMOPOLITAN_THIRD_PARTY_LUA_LREPL_H_
|
|
#include "third_party/linenoise/linenoise.h"
|
|
#include "third_party/lua/lauxlib.h"
|
|
COSMOPOLITAN_C_START_
|
|
|
|
extern bool lua_repl_blocking;
|
|
extern bool lua_repl_isterminal;
|
|
extern const char *lua_progname;
|
|
extern struct linenoiseState *lua_repl_linenoise;
|
|
extern linenoiseCompletionCallback *lua_repl_completions_callback;
|
|
|
|
void lua_freerepl(void);
|
|
void lua_repl_wock(void);
|
|
void lua_repl_lock(void);
|
|
void lua_repl_unlock(void);
|
|
int lua_loadline(lua_State *);
|
|
void lua_l_print(lua_State *);
|
|
void lua_initrepl(lua_State *);
|
|
void lua_sigint(lua_State *, int);
|
|
int lua_report(lua_State *, int);
|
|
int lua_runchunk(lua_State *, int, int);
|
|
void lua_l_message(const char *, const char *);
|
|
char *lua_readline_hint(const char *, const char **, const char **);
|
|
void lua_readline_completions(const char *, linenoiseCompletions *);
|
|
|
|
COSMOPOLITAN_C_END_
|
|
#endif /* COSMOPOLITAN_THIRD_PARTY_LUA_LREPL_H_ */
|