Merge V8 5.3.332.45. DO NOT MERGE
Test: Manual
FPIIM-449
Change-Id: Id3254828b068abdea3cb10442e0172a8c9a98e03
(cherry picked from commit 13e2dadd00298019ed862f2b2fc5068bba730bcf)
diff --git a/src/base/platform/semaphore.cc b/src/base/platform/semaphore.cc
index a7e522a..7bf5986 100644
--- a/src/base/platform/semaphore.cc
+++ b/src/base/platform/semaphore.cc
@@ -87,10 +87,6 @@
0, reinterpret_cast<uintptr_t>(&native_handle_) &
kSemaphoreAlignmentMask);
DCHECK(count >= 0);
-#if V8_LIBC_GLIBC
- // sem_init in glibc prior to 2.1 does not zero out semaphores.
- memset(&native_handle_, 0, sizeof(native_handle_));
-#endif
int result = sem_init(&native_handle_, 0, count);
DCHECK_EQ(0, result);
USE(result);
@@ -105,6 +101,9 @@
void Semaphore::Signal() {
int result = sem_post(&native_handle_);
+ // This check may fail with <libc-2.21, which we use on the try bots, if the
+ // semaphore is destroyed while sem_post is still executed. A work around is
+ // to extend the lifetime of the semaphore.
CHECK_EQ(0, result);
}