fb51bb6 KCM: Fix the per-client serialization queue

Authored and Committed by jhrozek 6 years ago
    KCM: Fix the per-client serialization queue
    
    Resolves:
        https://pagure.io/SSSD/sssd/issue/3372
    
    Fixes a race condition between one client request adding an operation to
    the hash table value, which was previously a linked list of operations,
    while another concurrent operation would remove the last remaining
    linked list element through its callback.
    
    Instead, the hash table value is now a separate 'queue head' structure
    which is only changed in a tevent request to make sure is is not
    processes concurrently with adding to the queue (which is also a tevent
    request).
    
    Reviewed-by: Pavel Březina <pbrezina@redhat.com>