mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-01 05:37:59 +02:00
[cairo-xlib] Initialize the global mutexes.
The xlib surface creation routines will eventually attempt to lock the global _cairo_xlib_display_mutex. Under the default environment this is a non-issue as the CAIRO_MUTEX_INITIALIZE/FINALIZE become no-ops under pthreads. However, for the sake of correctness (i.e. to silence the lockdep debugger!) insert a call to initialize the global mutexes at the start of the public entry points.
This commit is contained in:
parent
d2557cd5ee
commit
2f22510e22
1 changed files with 6 additions and 0 deletions
|
|
@ -2098,6 +2098,8 @@ cairo_xlib_surface_create (Display *dpy,
|
|||
return (cairo_surface_t*) &_cairo_surface_nil;
|
||||
}
|
||||
|
||||
CAIRO_MUTEX_INITIALIZE ();
|
||||
|
||||
return _cairo_xlib_surface_create_internal (dpy, drawable, screen,
|
||||
visual, NULL, width, height, 0);
|
||||
}
|
||||
|
|
@ -2122,6 +2124,8 @@ cairo_xlib_surface_create_for_bitmap (Display *dpy,
|
|||
int width,
|
||||
int height)
|
||||
{
|
||||
CAIRO_MUTEX_INITIALIZE ();
|
||||
|
||||
return _cairo_xlib_surface_create_internal (dpy, bitmap, screen,
|
||||
NULL, NULL, width, height, 1);
|
||||
}
|
||||
|
|
@ -2155,6 +2159,8 @@ cairo_xlib_surface_create_with_xrender_format (Display *dpy,
|
|||
int width,
|
||||
int height)
|
||||
{
|
||||
CAIRO_MUTEX_INITIALIZE ();
|
||||
|
||||
return _cairo_xlib_surface_create_internal (dpy, drawable, screen,
|
||||
NULL, format, width, height, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue