mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-08 07:53:17 +02: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>
|
||||
|
||||
* glib/Source.cs : remove from the hash by key.
|
||||
|
@ -60,6 +60,7 @@ namespace GLib {
|
||||
{
|
||||
IdleProxy p = new IdleProxy (hndlr);
|
||||
uint code = g_idle_add ((IdleHandler) p.proxy_handler, IntPtr.Zero);
|
||||
lock (Source.source_handlers)
|
||||
Source.source_handlers [code] = p;
|
||||
|
||||
return code;
|
||||
@ -73,7 +74,8 @@ namespace GLib {
|
||||
bool result = false;
|
||||
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;
|
||||
|
||||
if (p != null && p.real_handler == hndlr) {
|
||||
@ -84,6 +86,7 @@ namespace GLib {
|
||||
|
||||
foreach (object key in keys)
|
||||
Source.source_handlers.Remove (key);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -35,11 +35,13 @@ namespace GLib {
|
||||
internal void Remove ()
|
||||
{
|
||||
ArrayList keys = new ArrayList ();
|
||||
lock (Source.source_handlers) {
|
||||
foreach (uint code in Source.source_handlers.Keys)
|
||||
if (Source.source_handlers [code] == this)
|
||||
keys.Add (code);
|
||||
foreach (object key in keys)
|
||||
Source.source_handlers.Remove (key);
|
||||
}
|
||||
real_handler = null;
|
||||
proxy_handler = null;
|
||||
}
|
||||
@ -55,6 +57,7 @@ namespace GLib {
|
||||
|
||||
public static bool Remove (uint tag)
|
||||
{
|
||||
lock (Source.source_handlers)
|
||||
source_handlers.Remove (tag);
|
||||
return g_source_remove (tag);
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ namespace GLib {
|
||||
TimeoutProxy p = new TimeoutProxy (hndlr);
|
||||
|
||||
uint code = g_timeout_add (interval, (TimeoutHandler) p.proxy_handler, IntPtr.Zero);
|
||||
lock (Source.source_handlers)
|
||||
Source.source_handlers [code] = p;
|
||||
|
||||
return code;
|
||||
|
Loading…
Reference in New Issue
Block a user