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

Side by Side Diff: src/platform-openbsd.cc

Issue 18509003: Keep two empty lines between declarations for cpp files (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 5 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/platform-macos.cc ('k') | src/platform-posix.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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 while (true) { 713 while (true) {
714 int result = sem_trywait(&sem_); 714 int result = sem_trywait(&sem_);
715 if (result == 0) return true; // Successfully got semaphore. 715 if (result == 0) return true; // Successfully got semaphore.
716 if (!to) return false; // Timeout. 716 if (!to) return false; // Timeout.
717 CHECK(result == -1 && errno == EINTR); // Signal caused spurious wakeup. 717 CHECK(result == -1 && errno == EINTR); // Signal caused spurious wakeup.
718 usleep(ts.tv_nsec / 1000); 718 usleep(ts.tv_nsec / 1000);
719 to--; 719 to--;
720 } 720 }
721 } 721 }
722 722
723
723 Semaphore* OS::CreateSemaphore(int count) { 724 Semaphore* OS::CreateSemaphore(int count) {
724 return new OpenBSDSemaphore(count); 725 return new OpenBSDSemaphore(count);
725 } 726 }
726 727
727 728
728 void OS::SetUp() { 729 void OS::SetUp() {
729 // Seed the random number generator. We preserve microsecond resolution. 730 // Seed the random number generator. We preserve microsecond resolution.
730 uint64_t seed = Ticks() ^ (getpid() << 16); 731 uint64_t seed = Ticks() ^ (getpid() << 16);
731 srandom(static_cast<unsigned int>(seed)); 732 srandom(static_cast<unsigned int>(seed));
732 limit_mutex = CreateMutex(); 733 limit_mutex = CreateMutex();
733 } 734 }
734 735
735 736
736 void OS::TearDown() { 737 void OS::TearDown() {
737 delete limit_mutex; 738 delete limit_mutex;
738 } 739 }
739 740
740 741
741 } } // namespace v8::internal 742 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-macos.cc ('k') | src/platform-posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698