Commit a8a61d8
committed
Cygwin: pty: Make pcon_start handling more multi thread durable
Currently, if the CSI6n response is divided into "CSI10;2" and "R",
and another thread call master write() with "c", the data written to
nat pipe will be interleaved like "CSI10;2cR". The first "CSI10;2"
make the 'state' 1, and in state == 1, all the data written goes
to 'wpbuf[]'. This may break startup of pseudo console.
With this patch, the thread ID of the thread that write the first ESC
char to 'wpbuf[]' is stored in 'wp_tid', and only if the thread ID
matches 'wp_tid' will be written to 'wpbuf[]'.
Fixes: bb42852 ("Cygwin: pty: Implement new pseudo console support.")
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
(cherry picked from commit 2fa5104)1 parent 25a9e4d commit a8a61d8
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2191 | 2191 | | |
2192 | 2192 | | |
2193 | 2193 | | |
| 2194 | + | |
2194 | 2195 | | |
2195 | 2196 | | |
2196 | 2197 | | |
| |||
2203 | 2204 | | |
2204 | 2205 | | |
2205 | 2206 | | |
| 2207 | + | |
2206 | 2208 | | |
2207 | | - | |
| 2209 | + | |
2208 | 2210 | | |
2209 | 2211 | | |
2210 | 2212 | | |
| |||
2220 | 2222 | | |
2221 | 2223 | | |
2222 | 2224 | | |
2223 | | - | |
| 2225 | + | |
2224 | 2226 | | |
2225 | 2227 | | |
2226 | 2228 | | |
| |||
2231 | 2233 | | |
2232 | 2234 | | |
2233 | 2235 | | |
| 2236 | + | |
2234 | 2237 | | |
2235 | 2238 | | |
2236 | 2239 | | |
| |||
0 commit comments