get rid of redundant calls to RequestContext::saveContext()
authorPingjia Shan <pingjia@fb.com>
Sun, 19 Nov 2017 05:55:44 +0000 (21:55 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 19 Nov 2017 06:20:54 +0000 (22:20 -0800)
commitaa7f8dcd47b82f753862919d3456a961b30c0ab4
tree257506562cc99a699b9e3f4c164a12e40b260b84
parent13cc05eaec5c19feaedc0b7fec17a6272f4b3f83
get rid of redundant calls to RequestContext::saveContext()

Summary:
In the past, these calls were required.

Used to solve static destruction ordering issue.  Any static object that uses RequestContext must call this function in its constructor.

That is when we were using `static folly::ThreadLocal<std::shared_ptr<RequestContext>>`, which was non-leaky.

The problem being addressed is when we have some code of the form:

```lang=c++
void doWork() {
  static EventBase eb;
}
```

But now we are using `SingletonThreadLocal<std::shared_ptr<RequestContext>>`, which is leaky.

So the issue that these calls were there to address seems to have been resolved.

Reviewed By: yfeldblum

Differential Revision: D6332597

fbshipit-source-id: c6aba6620ef2fb3a344ea20f56c8b9c0cdf42c70
folly/io/async/AsyncTimeout.cpp
folly/io/async/EventBase.cpp
folly/io/async/NotificationQueue.h