summaryrefslogtreecommitdiff
path: root/src/cairo-mutex-type-private.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix deadlock in cairo-scaled-font.cAdrian Johnson2022-05-281-0/+7
| | | | | | | | | | | | | | | | When cairo_scaled_glyph_page_cache needs to remove entries, cairo-cache calls _cairo_hash_table_random_entry() with the predicate _cairo_scaled_glyph_page_can_remove(). This function checks that the glyph_page scaled_font is not locked by testing scaled_font->cache_frozen. The scaled font is locked in the cache-cache destroy entry callback: _cairo_scaled_glyph_page_pluck(). There is a race condition here between testing scaled_font->cache_frozen and locking the font. Fix this by adding a new CAIRO_MUTEX_TRY_LOCK mutex operation, and using it to test and lock the scaled font in _cairo_scaled_glyph_page_can_remove(). Fixes the multithreaded case in #440
* Update FSF addressAndrea Canciani2010-04-271-1/+1
| | | | | | | | | | | I updated the Free Software Foundation address using the following script. for i in $(git grep Temple | cut -d: -f1 ) do sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i" done Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
* Recursive mutex.Chris Wilson2010-01-221-1/+8
| | | | | | | Implement a recursive mutex which will be needed for cairo_device_t. In particular only pthreads by default is a non-recursive mutex (to my knowledge) - both win32 critical sections and mutexes on Quartz are recursive.
* Ensure that the scaled font is frozen for the lifetime of the scaled glyph.Chris Wilson2008-10-221-0/+3
| | | | | | | | | | | | | | | | 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.
* [mutex] s/HOLDS_MUTEX/MUTEX_IS_LOCKED/Chris Wilson2008-10-201-2/+2
| | | | Behdad prefers the latter to keep a clean namespace.
* Remove CAIRO_BEGIN_DECLS uses that ickle introduced while mergingBehdad Esfahbod2008-10-201-2/+0
|
* Add support for lockdep.Chris Wilson2008-10-171-1/+5
| | | | | | | | | | | | 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.
* Revamp the build system.Behdad Esfahbod2008-09-021-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.
* Use #include "cairo-*." instead of #include <cairo-*.h>Behdad Esfahbod2008-06-231-1/+1
| | | | | The rule is simple: <x.h> for system / other project includes, "x.h" for local includes.
* [cairo-mutex] Remove debugging stuff that I accidentally committedBehdad Esfahbod2008-06-011-20/+1
| | | | | We should add read mutex debugging facilities when the debugging infrastructure is in place.
* Fix whitespaceBehdad Esfahbod2008-05-281-4/+4
|
* [cairo-mutex] Prepare mutex infrastructure for adding mutex debugging facilitiesBehdad Esfahbod2008-05-271-142/+127
| | | | | | | | | 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.
* [src/check-doc-syntax.sh] Fix some bugs in the check and fix errors foundBehdad Esfahbod2008-05-091-10/+22
|
* [doc] Make sure all type names in docs are prefixed by #Behdad Esfahbod2008-01-281-3/+3
|
* [doc] Make sure all macro names in docs are prefixed by %Behdad Esfahbod2008-01-281-12/+12
|
* Make NO_MUTEX really mean no mutexesVladimir Vukicevic2007-09-181-3/+3
|
* Remove include of cairoint.h from *-private.h header files.Carl Worth2007-08-231-1/+3
| | | | | | | | | | | | These were recently added, (as part of sparse integration?), but they break boilerplate which reaches into at least cairo-types-private.h and cairo-scaled-font-private.h. But boilerplate cannot see cairoint.h or else it gets the internal sybol renaming, (with the INT_ prefix), and then all the test suite tests refuse to link. If this change reverts some recently-added functionality, (or cleanliness), then we'll just need to find some other way to add that back again without the breakage.
* [Makefile.am] Add target sparse to run sparse static source code analyzerBehdad Esfahbod2007-08-221-3/+1
| | | | There are still some bits not quite working.
* [cairo-mutex] Document the API for adding cairo_mutex_t implementationsBehdad Esfahbod2007-05-011-0/+83
|
* [cairo-mutex] Define a NOOP CAIRO_MUTEX_FINALIZE() for pthreadBehdad Esfahbod2007-05-011-0/+1
| | | | | | | | as now the mutex layer will define a generic CAIRO_MUTEX_FINALIZE() whenever the implementation defines CAIRO_MUTEX_FINI(). In the case of pthread however we don't need finalization as we don't have any place to call it, and pthread_mutex_destroy() doesn't do much anyway.
* [cairo-mutex] Remove NOOP definition of CAIRO_MUTEX_INITIALIZEBehdad Esfahbod2007-05-011-1/+0
| | | | | as now the mutex layer will use a NOOP CAIRO_MUTEX_INITIALIZE by default if the implementation does not define CAIRO_MUTEX_INIT.
* [cairo-mutex] Improve error message if no thread implementation foundBehdad Esfahbod2007-05-011-2/+2
| | | | | to put back Carl's "acknowledge and accept" clause (!) before suggesting use of CAIRO_NO_MUTEX.
* [cairo-mutex] Make CAIRO_MUTEX_INIT/FINI take mutex object, not pointer to itBehdad Esfahbod2007-05-011-12/+7
| | | | This is more consistent with CAIRO_MUTEX_LOCK/UNLOCK.
* [cairo-mutex] Make sure CAIRO_MUTEX_FINI() evaluates its argument onceBehdad Esfahbod2007-05-011-1/+2
|
* [cairo-mutex] Rename macro arguments from "name" to "mutex"Behdad Esfahbod2007-05-011-10/+10
|
* [cairo-mutex-private.h] Move implementation-specific parts to ↵Behdad Esfahbod2007-05-011-0/+131
cairo-mutex-type-private.h This fixes the problem reported by Dave Yeo that boilerplate wasn't building: In file included from ../src/cairo-scaled-font-private.h:44, from cairo-boilerplate.c:65: ../src/cairo-mutex-private.h:183: error: syntax error before "extern" ../src/cairo-mutex-private.h:184: error: syntax error before "void" ../src/cairo-mutex-private.h:185: error: syntax error before "void" make[3]: *** [cairo-boilerplate.lo] Error 1