diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-01-18 22:02:09 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-01-22 23:01:50 +0000 |
commit | 82f8aa548d70acf51b319000d7a5c176fc73da64 (patch) | |
tree | acbf28d94fb2180f1a39aa23301fa24da49423d9 /src/cairo-mutex-type-private.h | |
parent | d2f251f84b326c5f8825c9a631ea729f21891580 (diff) | |
download | cairo-82f8aa548d70acf51b319000d7a5c176fc73da64.tar.gz |
Recursive mutex.
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.
Diffstat (limited to 'src/cairo-mutex-type-private.h')
-rw-r--r-- | src/cairo-mutex-type-private.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cairo-mutex-type-private.h b/src/cairo-mutex-type-private.h index adf17bbed..4f34f508d 100644 --- a/src/cairo-mutex-type-private.h +++ b/src/cairo-mutex-type-private.h @@ -44,7 +44,7 @@ #include "cairo-compiler-private.h" #include "cairo-mutex-impl-private.h" -/* Only the following three are mandatory at this point */ +/* Only the following four are mandatory at this point */ #ifndef CAIRO_MUTEX_IMPL_LOCK # error "CAIRO_MUTEX_IMPL_LOCK not defined. Check cairo-mutex-impl-private.h." #endif @@ -54,6 +54,9 @@ #ifndef CAIRO_MUTEX_IMPL_NIL_INITIALIZER # error "CAIRO_MUTEX_IMPL_NIL_INITIALIZER not defined. Check cairo-mutex-impl-private.h." #endif +#ifndef CAIRO_RECURSIVE_MUTEX_IMPL_INIT +# error "CAIRO_RECURSIVE_MUTEX_IMPL_INIT not defined. Check cairo-mutex-impl-private.h." +#endif /* make sure implementations don't fool us: we decide these ourself */ @@ -156,6 +159,7 @@ #ifndef CAIRO_MUTEX_DEBUG typedef cairo_mutex_impl_t cairo_mutex_t; +typedef cairo_recursive_mutex_impl_t cairo_recursive_mutex_t; #else # define cairo_mutex_t cairo_mutex_impl_t #endif @@ -168,6 +172,9 @@ typedef cairo_mutex_impl_t cairo_mutex_t; #define CAIRO_MUTEX_FINI CAIRO_MUTEX_IMPL_FINI #define CAIRO_MUTEX_NIL_INITIALIZER CAIRO_MUTEX_IMPL_NIL_INITIALIZER +#define CAIRO_RECURSIVE_MUTEX_INIT CAIRO_RECURSIVE_MUTEX_IMPL_INIT +#define CAIRO_RECURSIVE_MUTEX_NIL_INITIALIZER CAIRO_RECURSIVE_MUTEX_IMPL_NIL_INITIALIZER + #ifndef CAIRO_MUTEX_IS_LOCKED # define CAIRO_MUTEX_IS_LOCKED(name) 1 #endif |