• Philip Pronin's avatar
    protect executor callback destruction · 0ee7dfe1
    Philip Pronin authored
    Summary:
    Callback destruction can involve user logic.  In practice, we
    found quite a bunch of patterns like:
    
    ```
    executor->add([x = someGuardObjectThatTriggersWorkInDtor] {
      ...
    });
    ```
    
    So ensure that dtor is
    
    * Executed under `RequestContextScopeGuard`,
    * Protected from leaking unhandled exceptions.
    
    Reviewed By: ot, luciang
    
    Differential Revision: D26744394
    
    fbshipit-source-id: 5fcca0287a98de919c3649a9613e6d54cc1a1ba3
    0ee7dfe1
ThreadPoolExecutor.cpp 16.4 KB