Fix EventBase destruction race in FiberManagerMap
authorAndrii Grynenko <andrii@fb.com>
Thu, 28 Jan 2016 00:08:08 +0000 (16:08 -0800)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Thu, 28 Jan 2016 00:20:26 +0000 (16:20 -0800)
commit1ac421a539aaf2f349591d4bee36c75ff0ee052c
tree7fb46dc8f2475f91015c952bb7f72a6274424099
parentdbf7c3d20fcfb28b260c7ecce9149f2cf8c37f22
Fix EventBase destruction race in FiberManagerMap

Summary:
Previously we could be reading from thread-local FiberManagerMap while it was modified.
This is now fixed by keeping a per-thread list of EventBases which need to be removed from local maps. On the fast-path no action is taken, since list will be empty.

Reviewed By: yfeldblum

Differential Revision: D2853921

fb-gh-sync-id: f05e1924dd2b97bfb359537de1909bbe193e0cb9
folly/AtomicIntrusiveLinkedList.h [new file with mode: 0644]
folly/AtomicLinkedList.h
folly/Makefile.am
folly/experimental/fibers/Fiber.h
folly/experimental/fibers/FiberManager.h
folly/experimental/fibers/FiberManagerMap.cpp
folly/test/AtomicLinkedListTest.cpp [new file with mode: 0644]