-
Notifications
You must be signed in to change notification settings - Fork 481
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
Remove CoreSuspender from interpose functions #5157
Conversation
since it may end up deadlocking, depending on what's in the call chain
I am fairly convinced that it is entirely unsafe, and inappropriate, to acquire a I am convinced that attempting to acquire a So exactly why are we acquiring a suspender in these situations in the first place? |
I had thought I found the CoreSuspender to be required in Let me turn this PR into a "remove all interposed CoreSuspenders" change |
It is likely that I'll add some asserts to monitor for certain thread-safety violations, but this is outside the scope of this PR. We could add an assert-check for a vmethod interpose entered by a thread that doesn't hold the core mutex. This will trigger in the event that such a method is called by a DF threaded worker, but that's intelligence that we could probably stand to learn anyway. I think we already have an assert for certain Lua operations without holding the core mutex; I have a PR in process that will move |
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 - did not confirm that this covers all interposes, however
I didn't do stonesense, but this should be everything in the main repo |
Historically, the problematic assertions were in
In particular, I suspect we have several places still calling Maybe it's possible that |
Also, stonesense doesn't use vmethod hooks so no changes should be needed there. (it well predates our vmethod machinery, and doesn't really integrate into the game aside from the overlay, which is/was renderer-level, essentially drawing a buffer on top of another without regard for DF's representation of anything). |
since it may end up deadlocking, depending on what's in the call chain