support critical sections, now that we have Yap.h

This commit is contained in:
Vítor Santos Costa 2011-03-02 09:19:35 +00:00
parent 7f3e510992
commit 824b5ff88e

View File

@ -30,6 +30,19 @@
#ifdef H
#undef H
#endif
/* vsc: needs defining before getting rid of YAP locks */
static inline int
do_startCritical(void) {
YAPEnterCriticalSection();
return 1;
}
static inline int
do_endCritical(void) {
YAPLeaveCriticalSection();
return 1;
}
#define startCritical do_startCritical()
#define endCritical do_endCritical()
#ifdef LOCK
#undef LOCK
#endif
@ -428,10 +441,6 @@ MT/TBD: how to handle this gracefully in the multi-threading case. Does
it mean anything?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* vsc: needs defining */
#define startCritical TRUE
#define endCritical TRUE
#ifndef TRUE
#define TRUE 1
#define FALSE 0
@ -772,8 +781,10 @@ COMMON(word) pl_write_canonical2(term_t stream, term_t term);
/* empty stub */
void setPrologFlag(const char *name, int flags, ...);
void PL_set_prolog_flag(const char *name, int flags, ...);
extern void setPrologFlag(const char *name, int flags, ...);
extern void PL_set_prolog_flag(const char *name, int flags, ...);
extern install_t PL_install_readline(void);
COMMON(int) saveWakeup(wakeup_state *state, int forceframe ARG_LD);
COMMON(void) restoreWakeup(wakeup_state *state ARG_LD);
@ -787,6 +798,8 @@ COMMON(int) numberVars(term_t t, nv_options *opts, int n ARG_LD);
COMMON(Buffer) codes_or_chars_to_buffer(term_t l, unsigned int flags,
int wide, CVT_result *status);
COMMON(bool) systemMode(bool accept);
static inline word
setBoolean(int *flag, term_t old, term_t new)
{ if ( !PL_unify_bool_ex(old, *flag) ||