summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-08-05 16:47:30 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-08-05 16:47:30 +0200
commit923553d7a7f6304c5608110e190d4dfb2b9700d0 (patch)
treef24fb24afa1499909427c6c43dcecf000adb653c
parent1841f759174c68321f1e6ffc26966bd11ea5c3fd (diff)
Update glib-sharp from SVN trunk
-rw-r--r--gstreamer-sharp/glib-sharp/GType.cs28
1 files changed, 18 insertions, 10 deletions
diff --git a/gstreamer-sharp/glib-sharp/GType.cs b/gstreamer-sharp/glib-sharp/GType.cs
index c3f0940..027535f 100644
--- a/gstreamer-sharp/glib-sharp/GType.cs
+++ b/gstreamer-sharp/glib-sharp/GType.cs
@@ -93,10 +93,12 @@ namespace GLib {
public static void Register (GType native_type, System.Type type)
{
- if (native_type != GType.Pointer && native_type != GType.Boxed && native_type != ManagedValue.GType)
- types[native_type.Val] = type;
- if (type != null)
- gtypes[type] = native_type;
+ lock (types) {
+ if (native_type != GType.Pointer && native_type != GType.Boxed && native_type != ManagedValue.GType)
+ types[native_type.Val] = type;
+ if (type != null)
+ gtypes[type] = native_type;
+ }
}
static GType ()
@@ -128,8 +130,10 @@ namespace GLib {
{
GType gtype;
- if (gtypes.Contains (type))
- return (GType)gtypes[type];
+ lock (types) {
+ if (gtypes.Contains (type))
+ return (GType)gtypes[type];
+ }
if (type.IsSubclassOf (typeof (GLib.Object))) {
gtype = GLib.Object.LookupGType (type);
@@ -181,8 +185,10 @@ namespace GLib {
public static Type LookupType (IntPtr typeid)
{
- if (types.Contains (typeid))
- return (Type)types[typeid];
+ lock (types) {
+ if (types.Contains (typeid))
+ return (Type)types[typeid];
+ }
string native_name = Marshaller.Utf8PtrToString (g_type_name (typeid));
@@ -365,8 +371,10 @@ namespace GLib {
internal static GType LookupGObjectType (System.Type t)
{
- if (gtypes.Contains (t))
- return (GType) gtypes [t];
+ lock (types) {
+ if (gtypes.Contains (t))
+ return (GType) gtypes [t];
+ }
PropertyInfo pi = t.GetProperty ("GType", BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.Public);
if (pi != null)