mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-03-01 07:07:07 +00:00
2005-02-28 Mike Kestner <mkestner@novell.com>
* glib/Idle.cs : add locking on the source_handlers. * glib/Source.cs : add locking on the source_handlers. * glib/Timeout.cs : add locking on the source_handlers. svn path=/trunk/gtk-sharp/; revision=41290
This commit is contained in:
parent
6d70444302
commit
57972ab070
|
@ -1,3 +1,9 @@
|
||||||
|
2005-02-28 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
|
* glib/Idle.cs : add locking on the source_handlers.
|
||||||
|
* glib/Source.cs : add locking on the source_handlers.
|
||||||
|
* glib/Timeout.cs : add locking on the source_handlers.
|
||||||
|
|
||||||
2005-02-25 Mike Kestner <mkestner@novell.com>
|
2005-02-25 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* glib/Source.cs : remove from the hash by key.
|
* glib/Source.cs : remove from the hash by key.
|
||||||
|
|
|
@ -60,6 +60,7 @@ namespace GLib {
|
||||||
{
|
{
|
||||||
IdleProxy p = new IdleProxy (hndlr);
|
IdleProxy p = new IdleProxy (hndlr);
|
||||||
uint code = g_idle_add ((IdleHandler) p.proxy_handler, IntPtr.Zero);
|
uint code = g_idle_add ((IdleHandler) p.proxy_handler, IntPtr.Zero);
|
||||||
|
lock (Source.source_handlers)
|
||||||
Source.source_handlers [code] = p;
|
Source.source_handlers [code] = p;
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
@ -73,7 +74,8 @@ namespace GLib {
|
||||||
bool result = false;
|
bool result = false;
|
||||||
ArrayList keys = new ArrayList ();
|
ArrayList keys = new ArrayList ();
|
||||||
|
|
||||||
foreach (uint code in Source.source_handlers.Keys){
|
lock (Source.source_handlers) {
|
||||||
|
foreach (uint code in Source.source_handlers.Keys) {
|
||||||
IdleProxy p = Source.source_handlers [code] as IdleProxy;
|
IdleProxy p = Source.source_handlers [code] as IdleProxy;
|
||||||
|
|
||||||
if (p != null && p.real_handler == hndlr) {
|
if (p != null && p.real_handler == hndlr) {
|
||||||
|
@ -84,6 +86,7 @@ namespace GLib {
|
||||||
|
|
||||||
foreach (object key in keys)
|
foreach (object key in keys)
|
||||||
Source.source_handlers.Remove (key);
|
Source.source_handlers.Remove (key);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,11 +35,13 @@ namespace GLib {
|
||||||
internal void Remove ()
|
internal void Remove ()
|
||||||
{
|
{
|
||||||
ArrayList keys = new ArrayList ();
|
ArrayList keys = new ArrayList ();
|
||||||
|
lock (Source.source_handlers) {
|
||||||
foreach (uint code in Source.source_handlers.Keys)
|
foreach (uint code in Source.source_handlers.Keys)
|
||||||
if (Source.source_handlers [code] == this)
|
if (Source.source_handlers [code] == this)
|
||||||
keys.Add (code);
|
keys.Add (code);
|
||||||
foreach (object key in keys)
|
foreach (object key in keys)
|
||||||
Source.source_handlers.Remove (key);
|
Source.source_handlers.Remove (key);
|
||||||
|
}
|
||||||
real_handler = null;
|
real_handler = null;
|
||||||
proxy_handler = null;
|
proxy_handler = null;
|
||||||
}
|
}
|
||||||
|
@ -55,6 +57,7 @@ namespace GLib {
|
||||||
|
|
||||||
public static bool Remove (uint tag)
|
public static bool Remove (uint tag)
|
||||||
{
|
{
|
||||||
|
lock (Source.source_handlers)
|
||||||
source_handlers.Remove (tag);
|
source_handlers.Remove (tag);
|
||||||
return g_source_remove (tag);
|
return g_source_remove (tag);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,7 @@ namespace GLib {
|
||||||
TimeoutProxy p = new TimeoutProxy (hndlr);
|
TimeoutProxy p = new TimeoutProxy (hndlr);
|
||||||
|
|
||||||
uint code = g_timeout_add (interval, (TimeoutHandler) p.proxy_handler, IntPtr.Zero);
|
uint code = g_timeout_add (interval, (TimeoutHandler) p.proxy_handler, IntPtr.Zero);
|
||||||
|
lock (Source.source_handlers)
|
||||||
Source.source_handlers [code] = p;
|
Source.source_handlers [code] = p;
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
|
Loading…
Reference in a new issue