Commit 2fa5104
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>1 parent c8bbec4 commit 2fa5104
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2208 | 2208 | | |
2209 | 2209 | | |
2210 | 2210 | | |
| 2211 | + | |
2211 | 2212 | | |
2212 | 2213 | | |
2213 | 2214 | | |
| |||
2220 | 2221 | | |
2221 | 2222 | | |
2222 | 2223 | | |
| 2224 | + | |
2223 | 2225 | | |
2224 | | - | |
| 2226 | + | |
2225 | 2227 | | |
2226 | 2228 | | |
2227 | 2229 | | |
| |||
2237 | 2239 | | |
2238 | 2240 | | |
2239 | 2241 | | |
2240 | | - | |
| 2242 | + | |
2241 | 2243 | | |
2242 | 2244 | | |
2243 | 2245 | | |
| |||
2248 | 2250 | | |
2249 | 2251 | | |
2250 | 2252 | | |
| 2253 | + | |
2251 | 2254 | | |
2252 | 2255 | | |
2253 | 2256 | | |
| |||
0 commit comments