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

Unified Diff: src/base/platform/semaphore.cc

Issue 2304203002: Remove semaphore alignment check for posix platform. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/platform/semaphore.cc
diff --git a/src/base/platform/semaphore.cc b/src/base/platform/semaphore.cc
index fb4a2cab935e87398fee28c31ce2e5c8f944ea04..346705fd024601c977bc9d91a7d482aa9c27143d 100644
--- a/src/base/platform/semaphore.cc
+++ b/src/base/platform/semaphore.cc
@@ -73,19 +73,6 @@ bool Semaphore::WaitFor(const TimeDelta& rel_time) {
#elif V8_OS_POSIX
Semaphore::Semaphore(int count) {
- // The sem_init() does not check for alignment of the native handle.
- // Unaligned native handle can later cause a failure in semaphore signal.
- // Check the alignment here to catch the failure earlier.
- // Context: crbug.com/605349.
-#if V8_OS_AIX || V8_OS_FREEBSD
- // On aix sem_t is of type int. On FreeBSD, it's a struct of 32 bits fields.
- const uintptr_t kSemaphoreAlignmentMask = sizeof(int) - 1;
-#else
- const uintptr_t kSemaphoreAlignmentMask = sizeof(void*) - 1;
-#endif
- CHECK_EQ(
- 0, reinterpret_cast<uintptr_t>(&native_handle_) &
- kSemaphoreAlignmentMask);
DCHECK(count >= 0);
int result = sem_init(&native_handle_, 0, count);
DCHECK_EQ(0, result);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698