Index: src/platform-posix.cc |
=================================================================== |
--- src/platform-posix.cc (revision 11005) |
+++ src/platform-posix.cc (working copy) |
@@ -307,14 +307,14 @@ |
#if defined(V8_TARGET_ARCH_IA32) |
static OS::MemCopyFunction memcopy_function = NULL; |
-static Mutex* memcopy_function_mutex = OS::CreateMutex(); |
+static LazyMutex memcopy_function_mutex = LAZY_MUTEX_INITIALIZER; |
// Defined in codegen-ia32.cc. |
OS::MemCopyFunction CreateMemCopyFunction(); |
// Copy memory area to disjoint memory area. |
void OS::MemCopy(void* dest, const void* src, size_t size) { |
if (memcopy_function == NULL) { |
- ScopedLock lock(memcopy_function_mutex); |
+ ScopedLock lock(memcopy_function_mutex.Pointer()); |
if (memcopy_function == NULL) { |
OS::MemCopyFunction temp = CreateMemCopyFunction(); |
MemoryBarrier(); |