8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-31 05:23:02 +01:00
firebird-mirror/src/jrd/thread_proto.h

58 lines
964 B
C
Raw Normal View History

#ifndef THREAD_PROTO_H
#define THREAD_PROTO_H
//
//
#include "../jrd/thd.h"
#include "../jrd/sch_proto.h"
#include "../jrd/thd_proto.h"
#ifdef MULTI_THREAD
#ifdef SUPERSERVER
inline void THREAD_ENTER(){
SCH_enter();
}
inline void THREAD_EXIT(){
SCH_exit();
}
inline bool THREAD_VALIDATE(){
return SCH_validate();
}
#define SWEEP_THREAD
//#define GARBAGE_THREAD
#else // SUPERSERVER
inline void THREAD_ENTER(){
gds__thread_enter();
}
inline void THREAD_EXIT(){
gds__thread_exit();
}
inline bool THREAD_VALIDATE(){
return false;
}
#define AST_THREAD
#endif // SUPERSERVER
inline void THREAD_SLEEP(ULONG msecs){
THD_sleep(msecs);
}
inline void THREAD_YIELD(){
THD_yield();
}
#else // MULTI_THREAD
inline void THREAD_ENTER(){
}
inline void THREAD_EXIT(){
}
inline bool THREAD_VALIDATE(){
return false;
}
inline void THREAD_SLEEP(ULONG msecs){
THD_sleep(msecs);
}
inline void THREAD_YIELD(){
THD_yield();
}
#endif // MULTI_THREAD
#endif // THREAD_PROTO_H