Comment 350 for bug 195698

Revision history for this message
In , Brian J. Murrell (brian-interlinx) wrote :

Maybe I am stating the obvious, and I have definitely not looked at the source, but from a code point of view, it seems to me that these various input routines need to be "global" in nature (in reference to all of the threads that multiple tabs create) and needs to function in such a manner, assuming a tab calls such a globally aware "get_password()" function:

char * get_password() {

    static int dialog_active = false;
    static char *password = NULL;

    if (password)
        return password;

    if (dialog_active)
        while (!password)
            sleep(1);
    else
        password = password_dialog();

    return password;

}

The spinloop on password is lame, I know, but I am sure somebody more familiar with the toolkit can come up with some form of non-spinning wait.

And of course, as always, the devil is in the details... :-)