Switch HHWheelTimer::SharedPtr to a standard shared pointer
authorChad Parry <cparry@fb.com>
Tue, 24 May 2016 18:05:14 +0000 (11:05 -0700)
committerFacebook Github Bot 3 <facebook-github-bot-3-bot@fb.com>
Tue, 24 May 2016 18:08:24 +0000 (11:08 -0700)
commit81959105c3c084dce3e8d7c0c957a19f02f725a8
treebe8efc01454640fafabb7913bc6aa33dd5b1b4bd
parent0558fb60f996b14a826e70170781b5afcde5f5bf
Switch HHWheelTimer::SharedPtr to a standard shared pointer

Summary:
As part of my campaign to get `HHWheelTimer` away from intrusive ref-counting semantics, (cf. D3237530), I am redefining `HHWheelTimer::SharedPtr`. It is now a true `std::shared_ptr`. This will break clients that attempt the following:

  HHWheelTimer::UniquePtr timer1{HHWheelTimer::newTimer()};
  HHWheelTimer::SharedPtr timer2{timer1};

In the past, that code would compile, because `timer2` could use the intrusive ref-counting, and `timer1` would still be valid. After this change, the second timer would need to be initialized with `std::move(timer1)` instead. The `UniquePtr` is starting to actually be unique.

There is only one place in the code that actually tries to do such a copy. It's in a test, which I have changed. Any other instances of that behavior would create a compilation error, so it's impossible for one to be overlooked.

Reviewed By: djwatson

Differential Revision: D3337038

fbshipit-source-id: 085e4da41c9a142d253a1ac0b1dd0fc508dff704
folly/io/async/HHWheelTimer.h
folly/io/async/test/HHWheelTimerTest.cpp