4898470 Issue 50646 - Improve task handling during shutdowns

Authored and Committed by mreynolds 4 years ago
    Issue 50646 - Improve task handling during shutdowns
    
    Bug Description:  There is a race condition when stopping the server and
                      a running import task that can cause a heap-use-after-free.
    
    Fix Description:  For an import task, encapsulate the import thread with
                      a global thread increment/decrement (just like the export
                      task).  Also improved how tasks are notified to abort by
                      notifiying them before we wait for active threads to finish.
                      Then the tasks get destroyed after all threads are complete.
    
    relates: https://pagure.io/389-ds-base/issue/50646
    
    Reviewed by: lkrispen & tbordaz (Thanks!!)
    
        
file modified
+5 -0
file modified
+1 -1
file modified
+25 -15