[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:
Chris Wilson 2007-10-05 16:23:12 +01:00
parent d2557cd5ee
commit 2f22510e22

View file

@ -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);
}