gvalue_type = (Struct) glib_ns.scope.lookup ("Value");
gvariant_type = (Class) glib_ns.scope.lookup ("Variant");
gsource_type = (Class) glib_ns.scope.lookup ("Source");
- mutex_type = (Struct) glib_ns.scope.lookup ("StaticRecMutex");
if (context.require_glib_version (2, 32)) {
gmutex_type = (Struct) glib_ns.scope.lookup ("Mutex");
grecmutex_type = (Struct) glib_ns.scope.lookup ("RecMutex");
grwlock_type = (Struct) glib_ns.scope.lookup ("RWLock");
gcond_type = (Struct) glib_ns.scope.lookup ("Cond");
+
+ mutex_type = grecmutex_type;
+ } else {
+ mutex_type = (Struct) glib_ns.scope.lookup ("StaticRecMutex");
}
type_module_type = (TypeSymbol) glib_ns.scope.lookup ("TypeModule");
pop_context ();
if (finalize_context != null) {
+ string mutex_clear;
+ if (context.require_glib_version (2, 32)) {
+ mutex_clear = "g_rec_mutex_clear";
+ } else {
+ mutex_clear = "g_static_rec_mutex_free";
+ }
+
push_context (finalize_context);
- var fc = new CCodeFunctionCall (new CCodeIdentifier ("g_static_rec_mutex_free"));
+ var fc = new CCodeFunctionCall (new CCodeIdentifier (mutex_clear));
fc.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, l));
ccode.add_expression (fc);
pop_context ();