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

Side by Side Diff: src/isolate.cc

Issue 23748003: Cleanup Semaphore class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Build fix for Mac OS X. 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/debug-agent.cc ('k') | src/log.cc » ('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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // of it being optimized away. 219 // of it being optimized away.
220 OS::StrNCpy(local_buffer, "PreallocatedMemoryThread shutting down.\n", 220 OS::StrNCpy(local_buffer, "PreallocatedMemoryThread shutting down.\n",
221 local_buffer.length()); 221 local_buffer.length());
222 } 222 }
223 223
224 224
225 private: 225 private:
226 PreallocatedMemoryThread() 226 PreallocatedMemoryThread()
227 : Thread("v8:PreallocMem"), 227 : Thread("v8:PreallocMem"),
228 keep_running_(true), 228 keep_running_(true),
229 wait_for_ever_semaphore_(OS::CreateSemaphore(0)), 229 wait_for_ever_semaphore_(new Semaphore(0)),
230 data_ready_semaphore_(OS::CreateSemaphore(0)), 230 data_ready_semaphore_(new Semaphore(0)),
231 data_(NULL), 231 data_(NULL),
232 length_(0) { 232 length_(0) {
233 } 233 }
234 234
235 // Used to make sure that the thread keeps looping even for spurious wakeups. 235 // Used to make sure that the thread keeps looping even for spurious wakeups.
236 bool keep_running_; 236 bool keep_running_;
237 237
238 // This semaphore is used by the PreallocatedMemoryThread to wait for ever. 238 // This semaphore is used by the PreallocatedMemoryThread to wait for ever.
239 Semaphore* wait_for_ever_semaphore_; 239 Semaphore* wait_for_ever_semaphore_;
240 // Semaphore to signal that the data has been initialized. 240 // Semaphore to signal that the data has been initialized.
(...skipping 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after
2527 2527
2528 #ifdef DEBUG 2528 #ifdef DEBUG
2529 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ 2529 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2530 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); 2530 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2531 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) 2531 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET)
2532 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) 2532 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET)
2533 #undef ISOLATE_FIELD_OFFSET 2533 #undef ISOLATE_FIELD_OFFSET
2534 #endif 2534 #endif
2535 2535
2536 } } // namespace v8::internal 2536 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/debug-agent.cc ('k') | src/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698