OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5196 * // V8 Now no longer locked. | 5196 * // V8 Now no longer locked. |
5197 * \endcode | 5197 * \endcode |
5198 */ | 5198 */ |
5199 class V8_EXPORT Unlocker { | 5199 class V8_EXPORT Unlocker { |
5200 public: | 5200 public: |
5201 /** | 5201 /** |
5202 * Initialize Unlocker for a given Isolate. | 5202 * Initialize Unlocker for a given Isolate. |
5203 */ | 5203 */ |
5204 V8_INLINE explicit Unlocker(Isolate* isolate) { Initialize(isolate); } | 5204 V8_INLINE explicit Unlocker(Isolate* isolate) { Initialize(isolate); } |
5205 | 5205 |
5206 /** Deprecated. Use Isolate version instead. */ | |
5207 V8_DEPRECATED(Unlocker()); | |
5208 | |
5209 ~Unlocker(); | 5206 ~Unlocker(); |
5210 private: | 5207 private: |
5211 void Initialize(Isolate* isolate); | 5208 void Initialize(Isolate* isolate); |
5212 | 5209 |
5213 internal::Isolate* isolate_; | 5210 internal::Isolate* isolate_; |
5214 }; | 5211 }; |
5215 | 5212 |
5216 | 5213 |
5217 class V8_EXPORT Locker { | 5214 class V8_EXPORT Locker { |
5218 public: | 5215 public: |
5219 /** | 5216 /** |
5220 * Initialize Locker for a given Isolate. | 5217 * Initialize Locker for a given Isolate. |
5221 */ | 5218 */ |
5222 V8_INLINE explicit Locker(Isolate* isolate) { Initialize(isolate); } | 5219 V8_INLINE explicit Locker(Isolate* isolate) { Initialize(isolate); } |
5223 | 5220 |
5224 /** Deprecated. Use Isolate version instead. */ | |
5225 V8_DEPRECATED(Locker()); | |
5226 | |
5227 ~Locker(); | 5221 ~Locker(); |
5228 | 5222 |
5229 /** | 5223 /** |
5230 * Start preemption. | 5224 * Start preemption. |
5231 * | 5225 * |
5232 * When preemption is started, a timer is fired every n milliseconds | 5226 * When preemption is started, a timer is fired every n milliseconds |
5233 * that will switch between multiple threads that are in contention | 5227 * that will switch between multiple threads that are in contention |
5234 * for the V8 lock. | 5228 * for the V8 lock. |
5235 */ | 5229 */ |
5236 static void StartPreemption(int every_n_ms); | 5230 static void StartPreemption(Isolate* isolate, int every_n_ms); |
5237 | 5231 |
5238 /** | 5232 /** |
5239 * Stop preemption. | 5233 * Stop preemption. |
5240 */ | 5234 */ |
5241 static void StopPreemption(); | 5235 static void StopPreemption(Isolate* isolate); |
5242 | 5236 |
5243 /** | 5237 /** |
5244 * Returns whether or not the locker for a given isolate, is locked by the | 5238 * Returns whether or not the locker for a given isolate, is locked by the |
5245 * current thread. | 5239 * current thread. |
5246 */ | 5240 */ |
5247 static bool IsLocked(Isolate* isolate); | 5241 static bool IsLocked(Isolate* isolate); |
5248 | 5242 |
5249 /** | 5243 /** |
5250 * Returns whether v8::Locker is being used by this V8 instance. | 5244 * Returns whether v8::Locker is being used by this V8 instance. |
5251 */ | 5245 */ |
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6501 */ | 6495 */ |
6502 | 6496 |
6503 | 6497 |
6504 } // namespace v8 | 6498 } // namespace v8 |
6505 | 6499 |
6506 | 6500 |
6507 #undef TYPE_CHECK | 6501 #undef TYPE_CHECK |
6508 | 6502 |
6509 | 6503 |
6510 #endif // V8_H_ | 6504 #endif // V8_H_ |
OLD | NEW |