blob: d411f7bd6168ab2a049323ee7e7ae2ee156cc737 [file] [log] [blame]
//===--------- MutatorThread.h - Thread for GC ----------------------------===//
//
// The VMKit project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MVM_MUTATOR_THREAD_H
#define MVM_MUTATOR_THREAD_H
#include "mvm/Allocator.h"
#include "mvm/Threads/Thread.h"
namespace mvm {
class MutatorThread : public mvm::Thread {
public:
MutatorThread(VMKit* vmkit) : mvm::Thread(vmkit) {
MutatorContext = 0;
}
mvm::ThreadAllocator Allocator;
uintptr_t MutatorContext;
/// realRoutine - The function to invoke when the thread starts.
///
void (*realRoutine)(mvm::Thread*);
static void init(Thread* _th);
static MutatorThread* get() {
return (MutatorThread*)mvm::Thread::get();
}
virtual int start(void (*fct)(mvm::Thread*)) {
realRoutine = fct;
routine = init;
return Thread::start(init);
}
};
}
#endif