summaryrefslogtreecommitdiff
path: root/src/cairo-mutex-impl-private.h
AgeCommit message (Collapse)AuthorFilesLines
2009-10-15[build] Link against pthread-stubsChris Wilson1-1/+1
Avoid pulling in the real pthread library if the application is single threaded and not using pthreads, by linking against pthread-stubs instead.
2009-09-22Add WINVER defines to cairo-mutex-impl-privaye.hAdrian Johnson1-0/+9
The WINVER defines should always be defined before including windows.h
2009-09-22Use _WIN32 to check for win32 mutexAdrian Johnson1-1/+1
Commit 535bcaa1 moved pthread after win32 to fix mingw build problems. However this breaks cygwin builds. On cygwin HAVE_WINDOWS_H is defined but _WIN32 is not. This was causing windows.h to be included which defines _WIN32. As a result the win32 code in cairo-misc.c was being compiled but the win32 declaration in cairint.h was not included. Fix this by using _WIN32 to enable the win32 mutex functions since _WIN32 is defined by mingw, visual C++, and winegcc, but not cygwin. On cygwin, posix functions are preferred as it is a unix emulation environment.
2009-09-03[mutex] Hook into pthread lastChris Wilson1-23/+24
Check for native mutex types before hooking into pthread, as this workarounds broken builds on mingw that confuse us by including the pthread header file.
2009-01-29Spelling corrections: s/it's/its/Daniel Holbert1-1/+1
As a fun itch to scratch, I've been fixing incorrect uses of the contraction "it's" in comments within the mozilla source tree (tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=458167 ), and I ran across 6 instances of this typo in mozilla's snapshot of cairo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2009-01-29[mutex] Civilise the comment.Chris Wilson1-1/+1
Note bene that Behdad does not like people shouting.
2009-01-28Avoid "empty body in an if-statement" warningJeff Muizelaar1-2/+3
Use '(void)expr;' instead of 'if (expr) ;' to avoid getting the warning. 'if (expr) {}' is an option, however '(void)expr;' seems like a more common idiom and getting warnings for __attribute__((warn_unsed_result)) functions is probably prefered.
2008-10-22Ensure that the scaled font is frozen for the lifetime of the scaled glyph.Chris Wilson1-1/+2
After discussing the scaled font locking with Behdad, it transpired that it is not sufficient for a font to be locked for the lifetime of a scaled glyph, but that the scaled font's glyph cache must be frozen for the glyph' lifetime. If the cache is not frozen, then there is a possibility that the glyph may be evicted before the reference goes out of scope i.e. the glyph becomes invalid whilst we are trying to use it. Since the freezing of the cache is the stronger barrier, we remove the locking/unlocking of the mutex from the backends and instead move the mutex acquisition into the freeze/thaw routines. Then update the rule on acquiring glyphs to enforce that the cache is frozen and review the usage of freeze/thaw by all the backends to ensure that the cache is frozen for the lifetime of the glyph.
2008-10-20[mutex] s/HOLDS_MUTEX/MUTEX_IS_LOCKED/Chris Wilson1-1/+1
Behdad prefers the latter to keep a clean namespace.
2008-10-20Remove CAIRO_BEGIN_DECLS uses that ickle introduced while mergingBehdad Esfahbod1-2/+0
2008-10-17Add support for lockdep.Chris Wilson1-0/+14
lockdep is a valgrind skin which performs pthread locking correctness validation. In particular it allows one to write assert(HOLDS_LOCK(mutex)) which both documents the preconditions for a function and enforces them when the program is run under lockdep. As an aide to lockdep (as it works by intercepting the pthread functions), all the mutexes should be initialised and destroyed using pthread_mutex_init() and pthread_mutex_destroy() rather than using static initializers and no-ops.
2008-09-23[mutex] Fix typo in commentsBehdad Esfahbod1-1/+1
2008-09-20Make checks happy againBehdad Esfahbod1-1/+1
Minor syntax changes and improved check regexps.
2008-09-20Add cairo-system.c for platform system-specific codeBehdad Esfahbod1-0/+8
This is where DLL initialization/finalization should be done for example. Moved the one for win32. For OS/2 just left a comment as the code needs more work. This change simplifies building shared and static libraries in the win32 makefiles.
2008-09-19[src/Makefile.am.analysis] Check that all headers can be compiled standaloneBehdad Esfahbod1-4/+0
This ensures that each header includes all headers it depends on. This is now enforced by "make check".
2008-09-19Make sure (and check) that all private headers include some cairo header firstBehdad Esfahbod1-0/+2
The macros CAIRO_BEGIN_DECLS and CAIRO_END_DECLS are declared in two places: config.h and cairo.h. On Win32 build there is no config.h. So, we can't rely on pulling CAIRO_BEGIN_DECLS from there. Hence, we now: * Not add those declarations to config.h anymore, * Test that every cairo private header includes some other cairo header before any other includes. These two are fairly enough to ensure that cairo.h is seen from all private headers. There's still the case of headers not including any header file at all. I'll fix that later.
2008-09-19Check for _MSC_VER in mutex implementation codeBehdad Esfahbod1-1/+1
Previously I made the mutex implementation code to use Windows mutexes conditional on HAVE_WINDOWS_H. This was suppposed to be a more wine-friendly version of checking for a Windows platform. However, it also meant that when compiling without config.h, one had to stuff a #define for HAVE_WINDOWS_H somewhere. Traditionally it was put in cairo-features-win32.h, and that practice was carried over even after my build system rewrite. Somewhere along the road I also decided that the mutex implementation header does not need to include anything other than config.h. So the hacked up HAVE_WINDOWS_H in cairo-features-win32.h was not being seen by its lone user. We now condition on any of HAVE_WINDOWS_H and _MSC_VER. So the hack can be removed altogether.
2008-09-02Revamp the build system.Behdad Esfahbod1-6/+0
Quick summary of changes: - Move list of cairo source files out of src/Makefile.am and into src/Sources.mk, - Generate files src/Config.mk and src/Config.mk.win32 that choose the right set of source files and headers based on configured backends and features. This drastically simplifies building using other build systems. The src/Makefile.win32 file needs to be updated to reflect these changes. - Add README files to various directories, - Add toplevel HACKING file.
2008-06-23Use #include "cairo-*." instead of #include <cairo-*.h>Behdad Esfahbod1-1/+1
The rule is simple: <x.h> for system / other project includes, "x.h" for local includes.
2008-05-27[cairo-mutex] Prepare mutex infrastructure for adding mutex debugging facilitiesBehdad Esfahbod1-0/+226
Essentially renaming cairo-mutex-type-private.h to cairo-mutex-impl-private.h and changing all its namespace from cairo_mutex to cairo_mutex_impl. cairo-mutex-type-private.h then does all the sanity checks on the implementation that used to be in cairo-mutex-private.h. Plus, defines macros for the cairo-mutex namespace to map to the cairo-mutex-impl namespace. This extra mapping layer allows for add debugging facilities.