Prevent multiple sequential unlock windows on parallel unlock calls
When I trigger multiple keyring unlocking actions in parallel, I get a long sequence of keyring unlock windows, even though I unlock it the first time.
I am not familiar with the codebase but it seems to me that there needs to be an if statement somewhere that aborts the unlock window if it is already unlocked, like (pseudocode):
// this is how I suspect the code looks right now
do_parallel(unlock,...); // problem occurs if we queue multiple unlocks at the same time
unlock()
{
if(locked) {queue_on_gnome_thread(create_unlock_window);} // works fine when used sequentially but not in parallel
}
create_unlock_window()
{
// add this:
if(!locked) {return;} // we don't need to unlock anymore
...
locked=false;
}
It occurs every time I try to pull multiple git repositories at the same time when the keyring is not already unlocked:
find . -maxdepth 5 -name .git -type d | rev | cut -c 6- | rev | parallel -j64 'echo -n {}... && git -C {} pull'
Edited by Konrad Höffner