adding a fibers compatible once flag
authorShubhanshu Agrawal <shubhanshu@fb.com>
Fri, 10 Nov 2017 01:35:30 +0000 (17:35 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 10 Nov 2017 01:45:15 +0000 (17:45 -0800)
commitb529367b595dd4da7e70569cbea36d30ace4fa39
tree74a13b0ffdf042b47481154674f2b174841da3bd
parent98c488e23b44105d0e1a5b1d5cd7dea10b5843d5
adding a fibers compatible once flag

Summary:
The current folly::once_flag is not compatible with folly fibers
and when using it with fibers is inefficient and also cause deadlocks.

This diff makes the once flag's mutex be a templatable paramter
and overrides it in fibers library with a fiber compatible mtuex.

Reviewed By: yfeldblum

Differential Revision: D6288508

fbshipit-source-id: 6f82e1794d1f417f8d267061f1702a26a7b4ff12
folly/fibers/CallOnce.h [new file with mode: 0644]
folly/fibers/TimedMutex.h
folly/synchronization/CallOnce.h