mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 21:45:20 +00:00
LibCore: Fix race conditions in TestLibCoreStream
It was possible for the "local_socket_read" and "local_socket_write" tests to fail because we had exited the EventLoop before BackgroundAction got around to invoking the completion callback. The crash happened when trying to deferred_invoke() on the background thread, calling Core::EventLoop::current() after said EventLoop had returned from exec(). Fix this by not passing a completion callback, since we didn't need one in the first place.
This commit is contained in:
parent
bdd2dba77b
commit
5d55a42ded
Notes:
sideshowbarker
2024-07-17 22:05:33 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5d55a42ded2
1 changed files with 2 additions and 2 deletions
|
@ -333,7 +333,7 @@ TEST_CASE(local_socket_read)
|
|||
|
||||
return 0;
|
||||
},
|
||||
[](int) {});
|
||||
nullptr);
|
||||
|
||||
event_loop.exec();
|
||||
::unlink("/tmp/test-socket");
|
||||
|
@ -372,7 +372,7 @@ TEST_CASE(local_socket_write)
|
|||
|
||||
return 0;
|
||||
},
|
||||
[](int) {});
|
||||
nullptr);
|
||||
|
||||
event_loop.exec();
|
||||
::unlink("/tmp/test-socket");
|
||||
|
|
Loading…
Add table
Reference in a new issue