Commit 3613ebd
committed
php#64: Refactor deadlock detection to use structured exceptions instead of warnings
- Add new Async\DeadlockError exception class extending Error
- Replace multiple async_warning() calls with single structured exception
- Implement proper exit_exception handling for inter-coroutine safety
- Update resolve_deadlocks() to set ZEND_ASYNC_EXIT_EXCEPTION correctly
- Add ZEND_ASYNC_EXCEPTION_DEADLOCK to async class enum (ID: 36)
- Extend async_get_class_ce() to support new exception type
- Update all deadlock tests to expect exception instead of warnings
- Fix memory leak by removing unnecessary GC_ADDREF calls
This change improves error handling by providing a single, catchable
DeadlockError exception instead of multiple warnings, while maintaining
proper coroutine cancellation behavior through exit_exception mechanism.
Tests updated:
- 001-deadlock-basic-test.phpt
- 002-deadlock-with-catch.phpt
- 003-deadlock-with-zombie.phpt
- 010-deadlock-after-cancel-with-zombie.phpt1 parent d10813d commit 3613ebd
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| |||
0 commit comments