Files
turso/core
Preston Thorpe 2d55099854 Merge 'mark completion as done only after callback will be executed' from Nikita Sivukhin
- otherwise, in multi-threading environment, other thread can think that
completion is finished and start execution
- this can lead to violated assertions (for example, page must be
loaded, but as callback is not executed yet assert will be fired)
Failing scenario:
1. main thread wants to execute pread - so it schedule IO and return
control to the caller
2. IO thread read data from the disk
3. IO thread executes complete(result)
4. complete func set result of the completion to Ok
5. main thread enter into the step loop again and check completion
status
6. completion marked as finished/is_completed - so main thread continue
execution
7. main thread check that page is loaded and fails with assertion -
because it's not loaded yet
8. IO thread executed the callback and finished the completion

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #2922
2025-09-04 19:44:17 -04:00
..
2025-09-02 18:25:20 +07:00
2025-08-21 14:45:00 -04:00
2025-06-23 19:52:13 +01:00
2025-06-30 10:01:03 +03:00
2025-08-15 17:08:53 -04:00
2025-01-28 14:55:38 -05:00
2025-09-01 11:11:25 -03:00
2025-06-23 19:52:13 +01:00
2025-08-30 03:10:39 -03:00
2025-01-28 14:55:38 -05:00
2025-06-23 19:52:13 +01:00
2025-09-02 18:25:20 +07:00
2025-09-04 13:04:53 +07:00
2025-06-30 09:54:13 +03:00
2025-08-21 15:23:59 -03:00