Commit f519c88f authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Let AtFork accept ptr-to-const handle

Summary: [Folly] Let `AtFork` accept ptr-to-`const` handle rather than requiring only ptr-to-non-`const`.

Reviewed By: luciang

Differential Revision: D19208255

fbshipit-source-id: c7a6ab42b7b652ebc4ea6465f80db37ef1d155df
parent 90222d1a
...@@ -31,7 +31,7 @@ namespace detail { ...@@ -31,7 +31,7 @@ namespace detail {
namespace { namespace {
struct AtForkTask { struct AtForkTask {
void* handle; void const* handle;
folly::Function<bool()> prepare; folly::Function<bool()> prepare;
folly::Function<void()> parent; folly::Function<void()> parent;
folly::Function<void()> child; folly::Function<void()> child;
...@@ -115,7 +115,7 @@ void AtFork::init() { ...@@ -115,7 +115,7 @@ void AtFork::init() {
} }
void AtFork::registerHandler( void AtFork::registerHandler(
void* handle, void const* handle,
folly::Function<bool()> prepare, folly::Function<bool()> prepare,
folly::Function<void()> parent, folly::Function<void()> parent,
folly::Function<void()> child) { folly::Function<void()> child) {
...@@ -124,7 +124,7 @@ void AtFork::registerHandler( ...@@ -124,7 +124,7 @@ void AtFork::registerHandler(
{handle, std::move(prepare), std::move(parent), std::move(child)}); {handle, std::move(prepare), std::move(parent), std::move(child)});
} }
void AtFork::unregisterHandler(void* handle) { void AtFork::unregisterHandler(void const* handle) {
if (!handle) { if (!handle) {
return; return;
} }
......
...@@ -25,11 +25,11 @@ namespace detail { ...@@ -25,11 +25,11 @@ namespace detail {
struct AtFork { struct AtFork {
static void init(); static void init();
static void registerHandler( static void registerHandler(
void* handle, void const* handle,
folly::Function<bool()> prepare, folly::Function<bool()> prepare,
folly::Function<void()> parent, folly::Function<void()> parent,
folly::Function<void()> child); folly::Function<void()> child);
static void unregisterHandler(void* handle); static void unregisterHandler(void const* handle);
}; };
} // namespace detail } // namespace detail
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment