< prev index next >

src/share/vm/runtime/thread.hpp

Print this page
rev 13526 : [mq]: 13512.patch


2079   static JavaThread* _thread_list;
2080   static int         _number_of_threads;
2081   static int         _number_of_non_daemon_threads;
2082   static int         _return_code;
2083   static int         _thread_claim_parity;
2084 #ifdef ASSERT
2085   static bool        _vm_complete;
2086 #endif
2087 
2088   static void initialize_java_lang_classes(JavaThread* main_thread, TRAPS);
2089   static void initialize_jsr292_core_classes(TRAPS);
2090  public:
2091   // Thread management
2092   // force_daemon is a concession to JNI, where we may need to add a
2093   // thread to the thread list before allocating its thread object
2094   static void add(JavaThread* p, bool force_daemon = false);
2095   static void remove(JavaThread* p);
2096   static bool includes(JavaThread* p);
2097   static JavaThread* first()                     { return _thread_list; }
2098   static void threads_do(ThreadClosure* tc);
2099   static void parallel_java_threads_do(ThreadClosure* tc);
2100 
2101   // Initializes the vm and creates the vm thread
2102   static jint create_vm(JavaVMInitArgs* args, bool* canTryAgain);
2103   static void convert_vm_init_libraries_to_agents();
2104   static void create_vm_init_libraries();
2105   static void create_vm_init_agents();
2106   static void shutdown_vm_agents();
2107   static bool destroy_vm();
2108   // Supported VM versions via JNI
2109   // Includes JNI_VERSION_1_1
2110   static jboolean is_supported_jni_version_including_1_1(jint version);
2111   // Does not include JNI_VERSION_1_1
2112   static jboolean is_supported_jni_version(jint version);
2113 
2114   // The "thread claim parity" provides a way for threads to be claimed
2115   // by parallel worker tasks.
2116   //
2117   // Each thread contains a a "parity" field. A task will claim the
2118   // thread only if its parity field is the same as the global parity,
2119   // which is updated by calling change_thread_claim_parity().
2120   //
2121   // For this to work change_thread_claim_parity() needs to be called
2122   // exactly once in sequential code before starting parallel tasks
2123   // that should claim threads.
2124   //
2125   // New threads get their parity set to 0 and change_thread_claim_parity()
2126   // never set the global parity to 0.
2127   static int thread_claim_parity() { return _thread_claim_parity; }
2128   static void change_thread_claim_parity();
2129   static void assert_all_threads_claimed() NOT_DEBUG_RETURN;
2130 
2131   // Apply "f->do_oop" to all root oops in all threads.
2132   // This version may only be called by sequential code.
2133   static void oops_do(OopClosure* f, CodeBlobClosure* cf);
2134   // This version may be called by sequential or parallel code.
2135   static void possibly_parallel_oops_do(bool is_par, OopClosure* f, CodeBlobClosure* cf, CodeBlobClosure* nmethods_cl = NULL);
2136   // This creates a list of GCTasks, one per thread.
2137   static void create_thread_roots_tasks(GCTaskQueue* q);
2138   // This creates a list of GCTasks, one per thread, for marking objects.
2139   static void create_thread_roots_marking_tasks(GCTaskQueue* q);
2140 
2141   // Apply "f->do_oop" to roots in all threads that
2142   // are part of compiled frames
2143   static void compiled_frame_oops_do(OopClosure* f, CodeBlobClosure* cf);
2144 
2145   static void convert_hcode_pointers();
2146   static void restore_hcode_pointers();
2147 
2148   // Sweeper
2149   static void nmethods_do(CodeBlobClosure* cf);
2150 
2151   // RedefineClasses support
2152   static void metadata_do(void f(Metadata*));
2153   static void metadata_handles_do(void f(Metadata*));
2154 
2155 #ifdef ASSERT




2079   static JavaThread* _thread_list;
2080   static int         _number_of_threads;
2081   static int         _number_of_non_daemon_threads;
2082   static int         _return_code;
2083   static int         _thread_claim_parity;
2084 #ifdef ASSERT
2085   static bool        _vm_complete;
2086 #endif
2087 
2088   static void initialize_java_lang_classes(JavaThread* main_thread, TRAPS);
2089   static void initialize_jsr292_core_classes(TRAPS);
2090  public:
2091   // Thread management
2092   // force_daemon is a concession to JNI, where we may need to add a
2093   // thread to the thread list before allocating its thread object
2094   static void add(JavaThread* p, bool force_daemon = false);
2095   static void remove(JavaThread* p);
2096   static bool includes(JavaThread* p);
2097   static JavaThread* first()                     { return _thread_list; }
2098   static void threads_do(ThreadClosure* tc);

2099 
2100   // Initializes the vm and creates the vm thread
2101   static jint create_vm(JavaVMInitArgs* args, bool* canTryAgain);
2102   static void convert_vm_init_libraries_to_agents();
2103   static void create_vm_init_libraries();
2104   static void create_vm_init_agents();
2105   static void shutdown_vm_agents();
2106   static bool destroy_vm();
2107   // Supported VM versions via JNI
2108   // Includes JNI_VERSION_1_1
2109   static jboolean is_supported_jni_version_including_1_1(jint version);
2110   // Does not include JNI_VERSION_1_1
2111   static jboolean is_supported_jni_version(jint version);
2112 
2113   // The "thread claim parity" provides a way for threads to be claimed
2114   // by parallel worker tasks.
2115   //
2116   // Each thread contains a a "parity" field. A task will claim the
2117   // thread only if its parity field is the same as the global parity,
2118   // which is updated by calling change_thread_claim_parity().
2119   //
2120   // For this to work change_thread_claim_parity() needs to be called
2121   // exactly once in sequential code before starting parallel tasks
2122   // that should claim threads.
2123   //
2124   // New threads get their parity set to 0 and change_thread_claim_parity()
2125   // never set the global parity to 0.
2126   static int thread_claim_parity() { return _thread_claim_parity; }
2127   static void change_thread_claim_parity();
2128   static void assert_all_threads_claimed() NOT_DEBUG_RETURN;
2129 
2130   // Apply "f->do_oop" to all root oops in all threads.
2131   // This version may only be called by sequential code.
2132   static void oops_do(OopClosure* f, CodeBlobClosure* cf);
2133   // This version may be called by sequential or parallel code.
2134   static void possibly_parallel_oops_do(bool is_par, OopClosure* f, CodeBlobClosure* cf);
2135   // This creates a list of GCTasks, one per thread.
2136   static void create_thread_roots_tasks(GCTaskQueue* q);
2137   // This creates a list of GCTasks, one per thread, for marking objects.
2138   static void create_thread_roots_marking_tasks(GCTaskQueue* q);
2139 
2140   // Apply "f->do_oop" to roots in all threads that
2141   // are part of compiled frames
2142   static void compiled_frame_oops_do(OopClosure* f, CodeBlobClosure* cf);
2143 
2144   static void convert_hcode_pointers();
2145   static void restore_hcode_pointers();
2146 
2147   // Sweeper
2148   static void nmethods_do(CodeBlobClosure* cf);
2149 
2150   // RedefineClasses support
2151   static void metadata_do(void f(Metadata*));
2152   static void metadata_handles_do(void f(Metadata*));
2153 
2154 #ifdef ASSERT


< prev index next >