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

Let AtFork ignore unregistration of nullptr objects

Summary: [Folly] Let `AtFork` ignore unregistration of `nullptr` objects - i.e., let `nullptr` objects be the way of signaling immunity from unregistration.

Reviewed By: luciang

Differential Revision: D19207380

fbshipit-source-id: 6dfee52bf815fc257697fb89d67f69cede0f39f6
parent f3dfa82a
......@@ -125,6 +125,9 @@ void AtFork::registerHandler(
}
void AtFork::unregisterHandler(void* object) {
if (!object) {
return;
}
auto& list = AtForkList::instance();
std::lock_guard<std::mutex> lg(list.tasksLock);
for (auto it = list.tasks.begin(); it != list.tasks.end(); ++it) {
......
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