Repository navigation
Separate dlopen_async callback data from dso struct. NFC - #18361
Merged
Merged
Conversation
Collaborator
Author
|
Also includes an added assert and a cleanup of a long JS line of code, which I made while working on #18345 |
kripken
reviewed
Dec 13, 2022
| pthread_rwlock_unlock(&lock); | ||
| p->onerror(p->user_data); | ||
| free(p); | ||
| data->onerror(data->user_data); |
Member
There was a problem hiding this comment.
Doesn't onerror take 2 params like onsuccess? In JS they both appear to.
Collaborator
Author
There was a problem hiding this comment.
For theese internal JS callbacks they both take two arguments yes. For those we use locally/internal dlopen_js_onsuccess and dlopen_js_onerror.
For the actual user callback passed to emscripten_dlopen (which is the user-facing ASI which doesn't change in this PR which is NFC) the onerror only takes one argument. This is because when emscripten_dlopen is called there is no handle to a dll, and no handle is ever passed back to the user, except in the success case.
kripken
approved these changes
Dec 13, 2022
Using fields embedded in the DSO struct (which is shared between threads) is not thread safe. This is needed as part of my fix for #18345
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using fields embedded in the DSO struct (which is shared between threads) is not thread safe.
This is needed as part of my fix for #18345