2004-05-18 00:30:09 +02:00
|
|
|
|
2004-05-21 08:16:17 +02:00
|
|
|
#ifndef JRD_THREAD_PROTO_H
|
|
|
|
#define JRD_THREAD_PROTO_H
|
2004-05-18 00:30:09 +02:00
|
|
|
//
|
|
|
|
//
|
|
|
|
#include "../jrd/thd.h"
|
|
|
|
#include "../jrd/sch_proto.h"
|
|
|
|
#include "../jrd/thd_proto.h"
|
|
|
|
|
|
|
|
#ifdef MULTI_THREAD
|
|
|
|
#ifdef SUPERSERVER
|
2004-05-21 08:16:17 +02:00
|
|
|
inline void THREAD_ENTER() {
|
2004-05-18 00:30:09 +02:00
|
|
|
SCH_enter();
|
|
|
|
}
|
2004-05-21 08:16:17 +02:00
|
|
|
inline void THREAD_EXIT() {
|
2004-05-18 00:30:09 +02:00
|
|
|
SCH_exit();
|
|
|
|
}
|
2004-05-21 08:16:17 +02:00
|
|
|
//inline bool THREAD_VALIDATE() {
|
2004-05-19 14:27:49 +02:00
|
|
|
// return SCH_validate();
|
|
|
|
//}
|
2004-05-18 00:30:09 +02:00
|
|
|
#define SWEEP_THREAD
|
|
|
|
//#define GARBAGE_THREAD
|
|
|
|
#else // SUPERSERVER
|
2004-05-21 08:16:17 +02:00
|
|
|
inline void THREAD_ENTER() {
|
2004-05-18 00:30:09 +02:00
|
|
|
gds__thread_enter();
|
|
|
|
}
|
|
|
|
inline void THREAD_EXIT(){
|
|
|
|
gds__thread_exit();
|
|
|
|
}
|
2004-05-21 08:16:17 +02:00
|
|
|
//inline bool THREAD_VALIDATE() {
|
2004-05-19 14:27:49 +02:00
|
|
|
// return true;
|
|
|
|
//}
|
2004-05-18 00:30:09 +02:00
|
|
|
#define AST_THREAD
|
|
|
|
#endif // SUPERSERVER
|
2004-05-21 08:16:17 +02:00
|
|
|
inline void THREAD_SLEEP(ULONG msecs) {
|
2004-05-18 00:30:09 +02:00
|
|
|
THD_sleep(msecs);
|
|
|
|
}
|
2004-05-21 08:16:17 +02:00
|
|
|
inline void THREAD_YIELD() {
|
2004-05-18 00:30:09 +02:00
|
|
|
THD_yield();
|
|
|
|
}
|
|
|
|
#else // MULTI_THREAD
|
2004-05-21 08:16:17 +02:00
|
|
|
inline void THREAD_ENTER() {
|
2004-05-18 00:30:09 +02:00
|
|
|
}
|
2004-05-21 08:16:17 +02:00
|
|
|
inline void THREAD_EXIT() {
|
2004-05-18 00:30:09 +02:00
|
|
|
}
|
2004-05-21 08:16:17 +02:00
|
|
|
//inline bool THREAD_VALIDATE() {
|
2004-05-19 14:27:49 +02:00
|
|
|
// return true;
|
|
|
|
//}
|
2004-05-21 08:16:17 +02:00
|
|
|
inline void THREAD_SLEEP(ULONG msecs) {
|
2004-05-18 00:30:09 +02:00
|
|
|
THD_sleep(msecs);
|
|
|
|
}
|
2004-05-21 08:16:17 +02:00
|
|
|
inline void THREAD_YIELD() {
|
2004-05-18 00:30:09 +02:00
|
|
|
THD_yield();
|
|
|
|
}
|
|
|
|
#endif // MULTI_THREAD
|
|
|
|
|
2004-05-21 08:16:17 +02:00
|
|
|
#endif // JRD_THREAD_PROTO_H
|