Skip to content
  • Travis Reitter's avatar
    Prevent extra "concurrent" PersonaStore.prepare() calls from one thread. · d94b174d
    Travis Reitter authored
    The lock() calls which were in place only prevent concurrent calls from
    different threads; however, the critical section could still be reached
    from two async calls in the same thread a la:
    
    backend.prepare.begin ((s,r) => {...});
    backend.prepare.begin ((s,r) => {...});
    
    The bodies of the handlers would not literally execute concurrently, but
    would be interleaved if each were sufficiently long. Our fix simply
    ignores any calls which happen while one is still working.
    
    (yield backend.prepare(); yield backend.prepare(); was already safe, of
    course)
    
    Helps: bgo#652637 - Don't hold locks across async calls
    d94b174d