Rare bug fix

Summary:
By the birthday paradox, this will fail about once every 8,100
runs. Dropping to 100 with cut that to 1 in 860,000.

Test Plan: fbconfig -r folly && fbmake runtests

Reviewed By: sdoroshenko@fb.com

Subscribers: sdwilsh, njormrod

FB internal diff: D1581238
Malloc cannot include ScopeGuard

Summary:
Because we put FBString and Malloc into libgcc, we have to be
careful which dependencies they each have. We cannot include ScopeGuard.
Reorganize the code a bit to avoid the ScopeGuard.

Test Plan: fbconfig -r folly && fbmake runtests

Reviewed By: je@fb.com

Subscribers: trunkagent, sdwilsh, njormrod

FB internal diff: D1580957
Use RWSpinLock for Singleton mutex

Summary: We only need exclusive lock when we add items to singletons_. Each SingletonEntry has its own mutex, so it's safe to rely on it for any modifications within individual entries.

Test Plan: Applied D1573880 and ran fbconfig -r servicerouter/client/cpp2 && fbmake runtests

Reviewed By: chip@fb.com

Subscribers: trunkagent, njormrod, hitesh, mshneer

FB internal diff: D1579877
Fix bug and unit test failure in HHWheelTimer

Summary: Some minor bug and a failed test caused by D1578466

Test Plan:
fbconfig thrift/lib/cpp/test:HHWheelTimerTest && fbmake
runtests

Reviewed By: davejwatson@fb.com

Subscribers: trunkagent, alandau, bmatheny, njormrod

FB internal diff: D1581949
Fix compiler warning in Subprocess

Summary: I'm going to have hhvm depend on Subprocess, found this build error in open source.  I figured the intent was to set r to the return code.  I could also delete the whole thing since it's unused.

Test Plan: Unit tests

Reviewed By: tudorb@fb.com

Subscribers: trunkagent, mwilliams, doug, njormrod

FB internal diff: D1583626
remove get_weak from singleton

Summary:

Test Plan: fbmake runtests, OBC no longer segfaults

Reviewed By: mshneer@fb.com

Subscribers: fbcode-common-diffs@, trunkagent, mcduff, marccelani, hitesh, mshneer, njormrod, lins

FB internal diff: D1573880
(Wangle) Make via behave more like gate

Summary:
Could the problem be that via continues the existing chain of futures,
whereas we actually want to start a new chain?

Is there any particular reason this wasn't implemented like this originally?

Test Plan:
Ran all the unit tests. I hope to try to reproduce the thread issue and
see if this improves things.

Reviewed By: davejwatson@fb.com

Subscribers: trunkagent, net-systems@, exa, njormrod, fugalh

FB internal diff: D1500225

Tasks: 4920689
Bump version to 11:0