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

Side by Side Diff: src/v8.cc

Issue 23625003: Cleanup Mutex and related classes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/spaces.cc ('k') | src/v8globals.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 OS::TearDown(); 128 OS::TearDown();
129 } 129 }
130 130
131 131
132 static void seed_random(uint32_t* state) { 132 static void seed_random(uint32_t* state) {
133 for (int i = 0; i < 2; ++i) { 133 for (int i = 0; i < 2; ++i) {
134 if (FLAG_random_seed != 0) { 134 if (FLAG_random_seed != 0) {
135 state[i] = FLAG_random_seed; 135 state[i] = FLAG_random_seed;
136 } else if (entropy_source != NULL) { 136 } else if (entropy_source != NULL) {
137 uint32_t val; 137 uint32_t val;
138 ScopedLock lock(entropy_mutex.Pointer()); 138 LockGuard<Mutex> lock_guard(entropy_mutex.Pointer());
139 entropy_source(reinterpret_cast<unsigned char*>(&val), sizeof(uint32_t)); 139 entropy_source(reinterpret_cast<unsigned char*>(&val), sizeof(uint32_t));
140 state[i] = val; 140 state[i] = val;
141 } else { 141 } else {
142 state[i] = random(); 142 state[i] = random();
143 } 143 }
144 } 144 }
145 } 145 }
146 146
147 147
148 // Random number generator using George Marsaglia's MWC algorithm. 148 // Random number generator using George Marsaglia's MWC algorithm.
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 ExternalReference::SetUp(); 328 ExternalReference::SetUp();
329 Bootstrapper::InitializeOncePerProcess(); 329 Bootstrapper::InitializeOncePerProcess();
330 } 330 }
331 331
332 332
333 void V8::InitializeOncePerProcess() { 333 void V8::InitializeOncePerProcess() {
334 CallOnce(&init_once, &InitializeOncePerProcessImpl); 334 CallOnce(&init_once, &InitializeOncePerProcessImpl);
335 } 335 }
336 336
337 } } // namespace v8::internal 337 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/spaces.cc ('k') | src/v8globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698