-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
GDScript: Lambda hotswap fixes #86569
GDScript: Lambda hotswap fixes #86569
Conversation
54fbda6
to
cd44925
Compare
trying to find out why only the linux builds are failing.. |
1b58b59
to
e7948de
Compare
oops it seems threadlocal var initializers arent re-entrant safe... only on linux, i rewrote it to be way simpler anyway, |
e7948de
to
ea37cf9
Compare
You should have seen its first iteration. 😆 Now seriously, I did my best to understand the intent of the original code so I could provide a fix. I had to make a few assumptions. I'm happy there's a proper patch now. |
@RandomShaper you did a good job, it was pretty bad code,,, |
28d9d59
to
7902c58
Compare
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.
LGTM. There are change requests by others, I agree with, though.
7902c58
to
7b7bbde
Compare
7b7bbde
to
49bce5c
Compare
Thanks! |
i think this should probably be cherry-picked for 4.2 ,, ill make a commit |
im glad #85248 got merged and fixed my mistakes from #81628
however,
it has some problems that this PR fixes:
thread_enter
andthread_exit
are inadequate for initializing the threadlocal lists, as external thread created by, FMOD for example, arent tracked at all, leading to a segfault when it tries to access the threadlocal listand,, another thing fixed by this:
crucially it works on my project that uses lambdas and needs hot-reloading to properly update them, where the current master commit fails,, lambdas just become invalid for all but 1 script
keeping only the relevant updateable func ptrs in each script with a mutex for each is enough to make this fast and safe in lambda creation, and script reloading and clearing.
and easier to read and modify the code
it should function as i meant it to originally in #81628 and now waste no time checking unrelated elements when reloading
the following recent related bugs are still gone after this PR:
but i could not reproduce #85151, if someone who can reproduce it can test that its still fixed after this PR i would be so grateful
sorry for the wait