stabilize IOFuturePool test
authorJames Sedgwick <jsedgwick@fb.com>
Wed, 17 Dec 2014 23:57:16 +0000 (15:57 -0800)
committerJoelMarcey <joelm@fb.com>
Thu, 18 Dec 2014 20:29:40 +0000 (12:29 -0800)
Summary: see attached task. concurrency is hard.

Test Plan: stress ran the hell out of it, induced failures before, can't after

Reviewed By: hans@fb.com

Subscribers: fugalh, folly-diffs@

FB internal diff: D1746879

Tasks: 5589311

Signature: t1:1746879:1418860467:0ec3f51a398eee8a836532770682a4c58758ce93

folly/experimental/wangle/concurrent/test/ThreadPoolExecutorTest.cpp

index 9898d40e68a405270650f13c90ba4a54d182b589..3e431073457cac1136ade32399d026b5a59d2d3b 100644 (file)
@@ -242,7 +242,7 @@ TEST(ThreadPoolExecutorTest, IOExpiration) {
 template <typename TPE>
 static void futureExecutor() {
   FutureExecutor<TPE> fe(2);
-  int c = 0;
+  std::atomic<int> c{0};
   fe.addFuture([] () { return makeFuture<int>(42); }).then(
     [&] (Try<int>&& t) {
       c++;