Skip to content
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

Stable-pointers are not thread-safe #73

Open
bpatrikm opened this issue Feb 18, 2020 · 0 comments
Open

Stable-pointers are not thread-safe #73

bpatrikm opened this issue Feb 18, 2020 · 0 comments

Comments

@bpatrikm
Copy link

In order to call gtk-functions from side-threads, one is supposed to use within-gtk-thread. This leads to a stable-pointer being set up with a lambda, which a callback then funcalls, and cleared by the finaliser of gdk-threads-add-idle-full. This is (claimed to be) thread safe within gtk, but the accesses to the 'stable-pointer'-variable are not safe. So if more than one Lisp-thread uses within-gtk-thread at the same time, one can end up with source-func-cb funcalling nil.

Putting mutex-locks around all uses of within-gtk-thread in user code will solve the issue, but it would be nicer to have it around just the stable-pointer access.

I'm not comfortable enough with multi-threading to propose to code achieve this, though. Sorry.

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

No branches or pull requests

1 participant