2004-05-21 08:16:17 +02:00
|
|
|
#ifndef JRD_THREAD_PROTO_H
|
|
|
|
#define JRD_THREAD_PROTO_H
|
2008-01-16 11:25:04 +01:00
|
|
|
|
2008-01-23 16:52:40 +01:00
|
|
|
#include "../common/thd.h"
|
2004-05-18 00:30:09 +02:00
|
|
|
#include "../jrd/sch_proto.h"
|
|
|
|
|
2004-05-21 08:16:17 +02:00
|
|
|
inline void THREAD_ENTER() {
|
2008-01-26 14:17:19 +01:00
|
|
|
gds__thread_enter();
|
2004-05-18 00:30:09 +02:00
|
|
|
}
|
2004-05-21 08:16:17 +02:00
|
|
|
inline void THREAD_EXIT() {
|
2008-01-26 14:17:19 +01:00
|
|
|
gds__thread_exit();
|
2004-05-18 00:30:09 +02:00
|
|
|
}
|
2006-04-25 09:37:19 +02:00
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
2008-01-17 14:07:03 +01:00
|
|
|
class SchedulerContext {
|
|
|
|
public:
|
|
|
|
SchedulerContext()
|
|
|
|
{
|
2008-01-26 14:17:19 +01:00
|
|
|
THREAD_ENTER();
|
2008-01-17 14:07:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
~SchedulerContext()
|
|
|
|
{
|
2008-01-26 14:17:19 +01:00
|
|
|
THREAD_EXIT();
|
2008-01-17 14:07:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
// copying is prohibited
|
|
|
|
SchedulerContext(const SchedulerContext&);
|
|
|
|
SchedulerContext& operator=(const SchedulerContext&);
|
|
|
|
};
|
|
|
|
|
2004-05-21 08:16:17 +02:00
|
|
|
#endif // JRD_THREAD_PROTO_H
|