mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-15 13:52:16 -08:00
New macros for handling the global lock
This commit is contained in:
parent
026623824b
commit
04ae0f3401
1 changed files with 9 additions and 0 deletions
|
|
@ -315,6 +315,13 @@ extern void cl_write_object(cl_object x, cl_object stream);
|
|||
# define PACKAGE_OP_UNLOCK() THREAD_OP_UNLOCK()
|
||||
# define ERROR_HANDLER_LOCK() THREAD_OP_LOCK()
|
||||
# define ERROR_HANDLER_UNLOCK() THREAD_OP_UNLOCK()
|
||||
# define ECL_WITH_GLOBAL_LOCK_BEGIN(the_env) \
|
||||
mp_get_lock_wait(cl_core.global_lock); \
|
||||
CL_UNWIND_PROTECT_BEGIN(the_env)
|
||||
# define ECL_WITH_GLOBAL_LOCK_END \
|
||||
CL_UNWIND_PROTECT_EXIT { \
|
||||
mp_giveup_lock(cl_core.global_lock); \
|
||||
} CL_UNWIND_PROTECT_END
|
||||
#else
|
||||
# define HASH_TABLE_LOCK(h)
|
||||
# define HASH_TABLE_UNLOCK(h)
|
||||
|
|
@ -322,6 +329,8 @@ extern void cl_write_object(cl_object x, cl_object stream);
|
|||
# define PACKAGE_OP_UNLOCK()
|
||||
# define ERROR_HANDLER_LOCK()
|
||||
# define ERROR_HANDLER_UNLOCK()
|
||||
# define ECL_WITH_GLOBAL_LOCK_BEGIN(the_env)
|
||||
# define ECL_WITH_GLOBAL_LOCK_END
|
||||
#endif /* ECL_THREADS */
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue