[vmkit-commits] [vmkit] r57174 - /vmkit/trunk/include/mvm/Threads/Thread.h
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Mon Oct 6 08:43:43 PDT 2008
Author: geoffray
Date: Mon Oct 6 10:43:43 2008
New Revision: 57174
URL: http://llvm.org/viewvc/llvm-project?rev=57174&view=rev
Log:
Comment.
Modified:
vmkit/trunk/include/mvm/Threads/Thread.h
Modified: vmkit/trunk/include/mvm/Threads/Thread.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/include/mvm/Threads/Thread.h?rev=57174&r1=57173&r2=57174&view=diff
==============================================================================
--- vmkit/trunk/include/mvm/Threads/Thread.h (original)
+++ vmkit/trunk/include/mvm/Threads/Thread.h Mon Oct 6 10:43:43 2008
@@ -20,23 +20,70 @@
namespace mvm {
+/// Thread - This class is the base of custom virtual machines' Thread classes.
+/// It provides static functions to manage threads. An instance of this class
+/// contains all thread-specific informations.
class Thread : public gc {
public:
+
+ /// yield - Yield the processor to another thread.
+ ///
static void yield(void);
- static void yield(unsigned int *);
+
+ /// yield - Yield the processor to another thread. If the thread has been
+ /// askink for yield already a number of times (n), then do a small sleep.
+ ///
+ static void yield(unsigned int* n);
+
+ /// self - The thread id of the current thread, which is specific to the
+ /// underlying implementation.
+ ///
static int self(void);
+
+ /// initialise - Initialise the thread implementation. Used for pthread_key.
+ ///
static void initialise(void);
+
+ /// kill - Kill the thread with the given pid by sending it a signal.
+ ///
static int kill(int tid, int signo);
+
+ /// exit - Exit the current thread.
+ ///
static void exit(int value);
- static int start(int *tid, int (*fct)(void *), void *arg);
+ /// start - Start the execution of a thread, creating it and setting its
+ /// Thread instance.
+ ///
+ static int start(int *tid, int (*fct)(void *), void *arg);
+
+ /// threadKey - the key for accessing the thread specific data.
+ ///
static mvm::Key<Thread>* threadKey;
+
+ /// GC - The collector of this thread.
+ ///
Collector* GC;
+
+ /// baseSP - The base stack pointer.
+ ///
void* baseSP;
+
+ /// threadID - The virtual machine specific thread id.
+ ///
uint32 threadID;
+
+ /// get - Get the thread specific data of the current thread.
+ ///
static Thread* get() {
return (Thread*)Thread::threadKey->get();
}
+
+ /// set - Set the thread specific data of the current thread.
+ ///
+ static void set(Thread* th) {
+ return Thread::threadKey->set(th);
+ }
};
More information about the vmkit-commits
mailing list