summaryrefslogtreecommitdiff
path: root/libjava/java/lang/Thread.h
blob: 54764c83c5abc221f2f9b6e6762957555dedda18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-

#ifndef __java_lang_Thread__
#define __java_lang_Thread__

#pragma interface

#include <java/lang/Object.h>
#include <gcj/array.h>

extern "Java"
{
  namespace gnu
  {
    namespace gcj
    {
        class RawData;
        class RawDataManaged;
    }
  }
}

class _Jv_JNIEnv;
#define _JV_NOT_OWNER 1
#define _JV_INTERRUPTED 2
_Jv_JNIEnv * _Jv_GetCurrentJNIEnv ();
void _Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);
void _Jv_ThreadRun (java::lang::Thread* thread);
jint _Jv_AttachCurrentThread(java::lang::Thread* thread);
java::lang::Thread* _Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);
java::lang::Thread* _Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);
jint _Jv_DetachCurrentThread ();
struct _Jv_Thread_t;
_Jv_Thread_t* _Jv_ThreadGetData (java::lang::Thread* thread);

class java::lang::Thread : public ::java::lang::Object
{

public:
  Thread();
  Thread(::java::lang::Runnable *);
  Thread(::java::lang::String *);
  Thread(::java::lang::ThreadGroup *, ::java::lang::Runnable *);
  Thread(::java::lang::ThreadGroup *, ::java::lang::String *);
  Thread(::java::lang::Runnable *, ::java::lang::String *);
  Thread(::java::lang::ThreadGroup *, ::java::lang::Runnable *, ::java::lang::String *);
  Thread(::java::lang::ThreadGroup *, ::java::lang::Runnable *, ::java::lang::String *, jlong);
public: // actually package-private
  Thread(::java::lang::String *, jboolean);
private:
  Thread(::java::lang::Thread *, ::java::lang::ThreadGroup *, ::java::lang::Runnable *, ::java::lang::String *, jboolean);
public:
  static jint activeCount();
  virtual void checkAccess();
  virtual jint countStackFrames();
  static ::java::lang::Thread * currentThread();
  virtual void destroy();
  static void dumpStack();
  static jint enumerate(JArray< ::java::lang::Thread * > *);
  virtual ::java::lang::String * getName();
  virtual jint getPriority();
  virtual ::java::lang::ThreadGroup * getThreadGroup();
  static jboolean holdsLock(::java::lang::Object *);
  virtual void interrupt();
  static jboolean interrupted();
  virtual jboolean isInterrupted();
  virtual jboolean isAlive();
  virtual jboolean isDaemon();
  virtual void join();
  virtual void join(jlong);
  virtual void join(jlong, jint);
  virtual void resume();
private:
  void finish_();
  jboolean isInterrupted(jboolean);
public:
  virtual void run();
  virtual void setDaemon(jboolean);
  virtual ::java::lang::ClassLoader * getContextClassLoader();
  virtual void setContextClassLoader(::java::lang::ClassLoader *);
  virtual void setName(::java::lang::String *);
  static void yield();
  static void sleep(jlong);
  static void sleep(jlong, jint);
  virtual void start();
  virtual void stop();
  virtual void stop(::java::lang::Throwable *);
  virtual void suspend();
  virtual void setPriority(jint);
  virtual ::java::lang::String * toString();
private:
  void initialize_native();
  static ::java::lang::String * gen_name();
public: // actually package-private
  static ::java::lang::ThreadLocalMap * getThreadLocals();
public:
  virtual void setUncaughtExceptionHandler(::java::lang::Thread$UncaughtExceptionHandler *);
  virtual ::java::lang::Thread$UncaughtExceptionHandler * getUncaughtExceptionHandler();
  static void setDefaultUncaughtExceptionHandler(::java::lang::Thread$UncaughtExceptionHandler *);
  static ::java::lang::Thread$UncaughtExceptionHandler * getDefaultUncaughtExceptionHandler();
  virtual jlong getId();
  virtual ::java::lang::Thread$State * getState();
  static ::java::util::Map * getAllStackTraces();
  virtual JArray< ::java::lang::StackTraceElement * > * getStackTrace();
  static const jint MIN_PRIORITY = 1;
  static const jint NORM_PRIORITY = 5;
  static const jint MAX_PRIORITY = 10;
public: // actually package-private
  ::java::lang::ThreadGroup * __attribute__((aligned(__alignof__( ::java::lang::Object)))) group;
private:
  ::java::lang::Runnable * runnable;
public: // actually package-private
  ::java::lang::String * name;
private:
  jboolean daemon;
  jint priority;
public: // actually package-private
  jboolean interrupt_flag;
private:
  static const jbyte THREAD_DEAD = 0;
  static const jbyte THREAD_ALIVE = 1;
  static const jbyte THREAD_SIGNALED = 2;
  jboolean startable_flag;
  ::java::lang::ClassLoader * contextClassLoader;
  jlong threadId;
  static jlong nextThreadId;
  static jlong totalThreadsCreated;
  static ::java::lang::Thread$UncaughtExceptionHandler * defaultHandler;
public: // actually package-private
  ::java::lang::ThreadLocalMap * locals;
  ::java::lang::Thread$UncaughtExceptionHandler * exceptionHandler;
private:
  ::java::lang::Object * parkBlocker;
public: // actually package-private
  static const jbyte THREAD_PARK_RUNNING = 0;
  static const jbyte THREAD_PARK_PERMIT = 1;
  static const jbyte THREAD_PARK_PARKED = 2;
  static const jbyte THREAD_PARK_DEAD = 3;
  ::java::lang::Object * accessControlState;
  ::gnu::gcj::RawData * interp_frame;
  ::gnu::gcj::RawData * frame;
  jint volatile state;
  ::gnu::gcj::RawDataManaged * data;
public:
  static ::java::lang::Class class$;

  friend _Jv_JNIEnv * ::_Jv_GetCurrentJNIEnv ();
  friend void ::_Jv_SetCurrentJNIEnv (_Jv_JNIEnv *env);
  friend void ::_Jv_ThreadRun (java::lang::Thread* thread);
  friend jint (::_Jv_AttachCurrentThread) (java::lang::Thread* thread);
  friend java::lang::Thread* ::_Jv_AttachCurrentThread (jstring name, java::lang::ThreadGroup* group);
  friend java::lang::Thread* ::_Jv_AttachCurrentThreadAsDaemon (jstring name, java::lang::ThreadGroup* group);
  friend jint (::_Jv_DetachCurrentThread) ();
};

#endif // __java_lang_Thread__