From: Anton Likhtarov Date: Tue, 23 Jun 2015 02:31:17 +0000 (-0700) Subject: Futex: ignore errors on wake X-Git-Tag: v0.48.0~22 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=75bad6260eb43739cede7ec49964ffc7c37ecfa9;p=folly.git Futex: ignore errors on wake Summary: See the comment for details Reviewed By: @nbronson Differential Revision: D2181231 --- diff --git a/folly/detail/Futex.cpp b/folly/detail/Futex.cpp index f3d7bb04..bef3c022 100644 --- a/folly/detail/Futex.cpp +++ b/folly/detail/Futex.cpp @@ -65,8 +65,13 @@ int nativeFutexWake(void* addr, int count, uint32_t wakeMask) { nullptr, /* addr2 */ wakeMask); /* val3 */ - assert(rv >= 0); - + /* NOTE: we ignore errors on wake for the case of a futex + guarding its own destruction, similar to this + glibc bug with sem_post/sem_wait: + https://sourceware.org/bugzilla/show_bug.cgi?id=12674 */ + if (rv < 0) { + return 0; + } return rv; }