Make sure to return from atomicHashArrayInsertRaceThread
authorChristopher Dykes <cdykes@fb.com>
Tue, 19 Jul 2016 02:49:24 +0000 (19:49 -0700)
committerFacebook Github Bot 8 <facebook-github-bot-8-bot@fb.com>
Tue, 19 Jul 2016 02:53:28 +0000 (19:53 -0700)
Summary: Because, unfortunately, `pthread_exit` is not marked as noreturn in the pthread library primarily used on Windows, we need to return something to avoid errors.

Reviewed By: yfeldblum

Differential Revision: D3571465

fbshipit-source-id: 4713b2364d6584ae255fb83cd21406fdc33ee299

folly/test/AtomicHashMapTest.cpp

index f884b4ed30542bbc97aa3eaf2504e3e48661a39f..e62e8386eeb605c5139f675135171ec5702c53b6 100644 (file)
@@ -21,6 +21,8 @@
 #include <thread>
 #include <atomic>
 #include <memory>
+
+#include <folly/Assume.h>
 #include <folly/Benchmark.h>
 #include <folly/Conv.h>
 #include <folly/portability/Atomic.h>
@@ -679,6 +681,7 @@ void* atomicHashArrayInsertRaceThread(void* /* j */) {
     }
   }
   pthread_exit((void *) numInserted);
+  folly::assume(false);
 }
 TEST(Ahm, atomic_hash_array_insert_race) {
   AHA* arr = atomicHashArrayInsertRaceArray.get();