Commit d55b448
libc: validate pthread timedlock timeout before locking; fix comment
Follow-up to the merged pthread_mutex_timedlock/clocklock (commit 92e6342)
addressing review feedback:
- Validate abs_timeout before the uncontended try_lock() fast path. POSIX
requires pthread_mutex_timedlock/clocklock to fail with EINVAL for an invalid
abs_timeout (NULL or tv_nsec out of [0,1e9)) and not acquire the mutex;
previously an uncontended lock succeeded before the timeout was checked.
- Replace the stray 'ponytail:' marker in the comment with a plain 'Note:'.1 parent 92e6342 commit d55b448
1 file changed
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
458 | | - | |
| 458 | + | |
| 459 | + | |
459 | 460 | | |
460 | | - | |
461 | | - | |
462 | | - | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
463 | 464 | | |
464 | 465 | | |
465 | 466 | | |
466 | | - | |
467 | | - | |
468 | | - | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
469 | 470 | | |
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
473 | 477 | | |
474 | 478 | | |
475 | 479 | | |
| |||
0 commit comments