Skip to content

Conversation

GameParrot
Copy link
Contributor

Adds skipLock to mcpelauncher_show_window and mcpelauncher_close_window

@ChristopherHX
Copy link
Member

I know the problem you are currently facing, but I'm still not happy with your approach of replacing a deadlock by data inconsistency errors that are hard to debug.

Inconsistent data structures, by modifying collections that are used to iterate.

I could rewrite the api so mcpelauncher_show_window and mcpelauncher_close_window no longer need to hold the lock that is used by the imgui render loop.

Your mod can use std::thread to call them in a new thread with their parameters on the stack as well.

@ChristopherHX
Copy link
Member

a recusive_mutex could fix the deadlock as well, but still has data inconsistency for closing / updating windows (create new is ok with a recusive mutex as I used a for loop with i).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants