Unnecessary delay in NamedPipe::cancelPendingReads

In the implementation of “NamedPipe::cancelPendingReads” for Linux and Mac the following loop waits for the thread reading from the pipe to terminate that:

        int timeout = 2000;
        while (intern->blocked && --timeout >= 0)
            sleep (2);

I’m quite sure you thought of “Thread::sleep” that sleep milliseconds, when you coded that. But a “NamedPipe” is not itself a Thread, so this code results in a call of the “sleep” in C runtime library, which sleeps seconds.
This means almost always a delay of 2 seconds, before the program can continue. To sleep only 2 milliseconds, I changed this code to:

        int timeout = 2000;
        while (intern->blocked && --timeout >= 0)
            ::usleep (2000);

oh - well spotted! Yep, I am in the habit of just using “sleep” to mean Thread::sleep. Thanks, I’ll sort that out.