Subject: bug#25247: 26.0.50; Concurrency crashes with XLib

From: Eli Zaretskii <[email-masked]>
Date: Fri, 30 Dec 2016 22:40:47 +0200

> Date: Fri, 30 Dec 2016 20:54:25 +0200
> From: Eli Zaretskii <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked]
> 
> I think the results are unexpected only because you think of the
> threads as running in parallel.  But they don't; only one thread runs
> at any given time, the rest are stuck, either in 'pselect', waiting
> for some input or time-out, or waiting for the global lock to become
> available.  And sleep-for yields to other threads (i.e. makes the
> global lock available).

And one additional piece of this puzzle is that you only see stuff
inserted into a buffer when redisplay runs.  And redisplay runs when
some thread waits for input and finds that none is available.