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

cairo thread safety #466

Closed
catfact opened this issue Jul 9, 2018 · 1 comment
Closed

cairo thread safety #466

catfact opened this issue Jul 9, 2018 · 1 comment
Labels

Comments

@catfact
Copy link
Collaborator

@catfact catfact commented Jul 9, 2018

thread safety in cairo (or the lack thereof) is a little unclear to me. it is supposed to generally be reentrant:
https://bugs.freedesktop.org/show_bug.cgi?id=74355
https://stackoverflow.com/questions/25726017/is-the-cairo-graphics-library-reentrant

but perhaps it isn't, or we aren't using it correctly, since there has been a report of this error when running the startup animation along with redraws from lua scripts:

matron: ../../../../src/cairo-pattern.c:1125: cairo_pattern_destroy: Assertion `CAIRO_REFERENCE_COUNT_HAS_REFERENCE (&pattern->ref_count)' failed.

( caveat: this error hasn't been noticed on norns hardware, only on rpi3 + push2 setup. )

if we can't call to the same cairo_t and cairo surface from different threads, then perhaps the most robust solution is to use the event loop for screen drawing requests.

other options:

  • move startup animation logic to main thread
  • give the startup animation thread its own cairo instance
@tehn
Copy link
Member

@tehn tehn commented Apr 7, 2019

revisited in #777

@tehn tehn closed this Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants