Commit 6416deb
win: almost fix race detecting ESRCH in uv_kill (libuv#4341)
It might happen that only using `WaitForSingleObject()` with timeout 0
could return WAIT_TIMEOUT as the process might not have been signaled
yet. To improve things, first use `GetExitCodeProcess()` and check
that `status` is not `STILL_ACTIVE`. Then, to cover for the case that the exit
code was actually `STILL_ACTIVE` use `WaitForSingleObject()`. This could
still be prone to the race condition but only for that case.1 parent fa16125 commit 6416deb
1 file changed
Lines changed: 30 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1364 | 1364 | | |
1365 | 1365 | | |
1366 | 1366 | | |
| 1367 | + | |
1367 | 1368 | | |
1368 | 1369 | | |
1369 | 1370 | | |
1370 | 1371 | | |
1371 | | - | |
| 1372 | + | |
1372 | 1373 | | |
1373 | 1374 | | |
1374 | | - | |
1375 | | - | |
1376 | | - | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1377 | 1395 | | |
1378 | 1396 | | |
1379 | 1397 | | |
1380 | 1398 | | |
1381 | 1399 | | |
1382 | 1400 | | |
1383 | 1401 | | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
1384 | 1410 | | |
1385 | 1411 | | |
1386 | 1412 | | |
| |||
0 commit comments