17 #ifndef _DECAF_LANG_THREAD_H_
18 #define _DECAF_LANG_THREAD_H_
38 class ThreadProperties;
70 ThreadProperties* properties;
75 static const int MIN_PRIORITY = 1;
78 static const int NORM_PRIORITY = 5;
81 static const int MAX_PRIORITY = 10;
129 virtual void uncaughtException(
const Thread* thread,
const Throwable& error) = 0;
167 Thread(
const std::string& name);
200 Thread(
Runnable* task,
const std::string& name,
long long stackSize);
212 virtual void start();
233 virtual void join(
long long millisecs);
247 virtual void join(
long long millisecs,
int nanos);
260 long long getId()
const;
266 std::string getName()
const;
273 void setName(
const std::string& name);
280 int getPriority()
const;
290 void setPriority(
int value);
297 UncaughtExceptionHandler* getUncaughtExceptionHandler()
const;
305 void setUncaughtExceptionHandler(UncaughtExceptionHandler* handler);
312 std::string toString()
const;
320 bool isAlive()
const;
348 bool isInterrupted()
const;
364 static void sleep(
long long millisecs);
381 static void sleep(
long long millisecs,
int nanos);
394 static Thread* currentThread();
403 static bool interrupted();
414 static UncaughtExceptionHandler* getDefaultUncaughtExceptionHandler();
424 static void setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler* handler);
429 void initializeSelf(
Runnable* task,
const std::string& name,
long long stackSize);