| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 using AttachedThreadStateSet = HashSet<ThreadState*>; | 179 using AttachedThreadStateSet = HashSet<ThreadState*>; |
| 180 static AttachedThreadStateSet& attachedThreads(); | 180 static AttachedThreadStateSet& attachedThreads(); |
| 181 static RecursiveMutex& threadAttachMutex(); | 181 static RecursiveMutex& threadAttachMutex(); |
| 182 static void lockThreadAttachMutex(); | 182 static void lockThreadAttachMutex(); |
| 183 static void unlockThreadAttachMutex(); | 183 static void unlockThreadAttachMutex(); |
| 184 | 184 |
| 185 // Initialize threading infrastructure. Should be called from the main | 185 // Initialize threading infrastructure. Should be called from the main |
| 186 // thread. | 186 // thread. |
| 187 static void init(); | 187 static void init(); |
| 188 static void shutdown(); | 188 static void shutdown(); |
| 189 static void shutdownHeapIfNecessary(); | |
| 190 bool isTerminating() { return m_isTerminating; } | 189 bool isTerminating() { return m_isTerminating; } |
| 191 | 190 |
| 192 static void attachMainThread(); | 191 static void attachMainThread(); |
| 193 static void detachMainThread(); | 192 static void detachMainThread(); |
| 194 | 193 |
| 195 // Trace all persistent roots, called when marking the managed heap objects. | 194 // Trace all persistent roots, called when marking the managed heap objects. |
| 196 static void visitPersistentRoots(Visitor*); | 195 static void visitPersistentRoots(Visitor*); |
| 197 | 196 |
| 198 // Trace all objects found on the stack, used when doing conservative GCs. | 197 // Trace all objects found on the stack, used when doing conservative GCs. |
| 199 static void visitStackRoots(Visitor*); | 198 static void visitStackRoots(Visitor*); |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 | 711 |
| 713 template<> class ThreadStateFor<AnyThread> { | 712 template<> class ThreadStateFor<AnyThread> { |
| 714 STATIC_ONLY(ThreadStateFor); | 713 STATIC_ONLY(ThreadStateFor); |
| 715 public: | 714 public: |
| 716 static ThreadState* state() { return ThreadState::current(); } | 715 static ThreadState* state() { return ThreadState::current(); } |
| 717 }; | 716 }; |
| 718 | 717 |
| 719 } // namespace blink | 718 } // namespace blink |
| 720 | 719 |
| 721 #endif // ThreadState_h | 720 #endif // ThreadState_h |
| OLD | NEW |