Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: src/platform-win32.cc

Issue 9664067: Use lazy instance initializer to remove static initializers in two places. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform-posix.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform-win32.cc
===================================================================
--- src/platform-win32.cc (revision 11012)
+++ src/platform-win32.cc (working copy)
@@ -208,13 +208,13 @@
#endif // _WIN64
-static Mutex* math_function_mutex = OS::CreateMutex();
+static LazyMutex math_function_mutex = LAZY_MUTEX_INITIALIZER;
#define UNARY_MATH_FUNCTION(name, generator) \
static UnaryMathFunction fast_##name##_function = NULL; \
double fast_##name(double x) { \
if (fast_##name##_function == NULL) { \
- ScopedLock lock(math_function_mutex); \
+ ScopedLock lock(math_function_mutex.Pointer()); \
UnaryMathFunction temp = generator; \
MemoryBarrier(); \
fast_##name##_function = temp; \
« no previous file with comments | « src/platform-posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698