Skip to content

Make usleep() and time_nanosleep() alertable on Windows - #24399

Open
nicolas-grekas wants to merge 2 commits into
php:PHP-8.4from
nicolas-grekas:windows-alertable-sleep
Open

nicolas-grekas wants to merge 2 commits into
php:PHP-8.4from
nicolas-grekas:windows-alertable-sleep

Conversation

@nicolas-grekas

@nicolas-grekas nicolas-grekas commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Allow APCs to interrupt usleep() and time_nanosleep() on Windows, as they already can with sleep(). time_nanosleep() reports the remaining duration, and time_sleep_until() resumes waiting until its deadline.

I spotted this while working on FrankenPHP and its ability to forcibly shutdown threads.

@nicolas-grekas
nicolas-grekas force-pushed the windows-alertable-sleep branch from 4424d99 to dffe371 Compare October 18, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant