-
Notifications
You must be signed in to change notification settings - Fork 188
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
Fix async arguments #738
base: master
Are you sure you want to change the base?
Fix async arguments #738
Conversation
src/async.c
Outdated
asarg->max = max; | ||
ret = uv_mutex_init(&asarg->mutex); | ||
if (ret < 0) { // unlikely | ||
abort(); |
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.
we shouldn't be aborting the program, this should be reported as a fail
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.
Fixed in commit 9fa42ef
This reverts commit 5827281.
I added the FIFO queue because it was mentioned in the issue #505 and made it optional for the sake of compatibility. The issue is quite clear but the fix in this PR is aguable so do not hesitate if you think about any other option. I could remove the queue from this PR, as this is a pure luv feature which will have to be supported in the long run! Thank you for your help |
Protect async
send()
arguments using a mutex.Use copy for async arguments rather than Lua reference.
Clear arguments in callback and before sending rather than after.
Keep existing and possibly weird behavior.
Allow async to use a FIFO queue.
Fixes #505