- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sleep(n) and Timer creation more MT-safe #32174
Changes from 1 commit
6f0088d
3d8312a
6fd062f
0596430
f2a2152
7afbd53
e85f00d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -1094,10 +1094,10 @@ JL_DLLEXPORT int jl_uv_update_timer_start(uv_loop_t* loop, uv_timer_t* handle, | |||||||
if (err) { | ||||||||
// TODO: this codepath is currently not tested | ||||||||
free(handle); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing JL_UV_UNLOCK on this codepath, also probably better to keep the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hopefully my latest commit addresses both of these properly 😄 |
||||||||
return NULL; | ||||||||
return err; | ||||||||
} | ||||||||
|
||||||||
jl_uv_associate_julia_struct(handle, handle); | ||||||||
jl_uv_associate_julia_struct((uv_handle_t *)handle, (jl_value_t *)handle); | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one of these things is not like the other—you can't cast to both libuv and julia There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I'm getting slightly confused by what's what, since in the following two locations it seems that we're already passing objects which (to my uneducated eyes) seem to end up with casts that are essentially the same as what you pointed out at: Line 90 in 4b0c8e7
Lines 102 to 103 in 4b0c8e7
Those two libuv calls don't expect a |
||||||||
uv_update_time(loop); | ||||||||
int r = uv_timer_start(handle, cb, timeout, repeat); | ||||||||
JL_UV_UNLOCK(); | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this actually can't fail, so we can just delete the error checking code (or make it an abort)