Tell select_thread to break out of its loop. Prevents a thread leak.
authorTor Lillqvist <tml@iki.fi>
Sat, 21 Aug 2004 21:29:35 +0000 (21:29 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sat, 21 Aug 2004 21:29:35 +0000 (21:29 +0000)
2004-08-21  Tor Lillqvist  <tml@iki.fi>

* glib/giowin32.c (g_io_win32_finalize): Tell select_thread to
break out of its loop. Prevents a thread leak. (#147392, Peter
Zelezny)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/giowin32.c

index bd25605..77d73c4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-08-21  Tor Lillqvist  <tml@iki.fi>
 
+       * glib/giowin32.c (g_io_win32_finalize): Tell select_thread to
+       break out of its loop. Prevents a thread leak. (#147392, Peter
+       Zelezny)
+
        * glib/gunicollate.c (g_utf8_collate_key): Guard against bogus
        return value from strxfrm(). For instance Microsoft's strxfrm()
        returns INT_MAX on errors. (#141124)
index bd25605..77d73c4 100644 (file)
@@ -1,5 +1,9 @@
 2004-08-21  Tor Lillqvist  <tml@iki.fi>
 
+       * glib/giowin32.c (g_io_win32_finalize): Tell select_thread to
+       break out of its loop. Prevents a thread leak. (#147392, Peter
+       Zelezny)
+
        * glib/gunicollate.c (g_utf8_collate_key): Guard against bogus
        return value from strxfrm(). For instance Microsoft's strxfrm()
        returns INT_MAX on errors. (#141124)
index bd25605..77d73c4 100644 (file)
@@ -1,5 +1,9 @@
 2004-08-21  Tor Lillqvist  <tml@iki.fi>
 
+       * glib/giowin32.c (g_io_win32_finalize): Tell select_thread to
+       break out of its loop. Prevents a thread leak. (#147392, Peter
+       Zelezny)
+
        * glib/gunicollate.c (g_utf8_collate_key): Guard against bogus
        return value from strxfrm(). For instance Microsoft's strxfrm()
        returns INT_MAX on errors. (#141124)
index bd25605..77d73c4 100644 (file)
@@ -1,5 +1,9 @@
 2004-08-21  Tor Lillqvist  <tml@iki.fi>
 
+       * glib/giowin32.c (g_io_win32_finalize): Tell select_thread to
+       break out of its loop. Prevents a thread leak. (#147392, Peter
+       Zelezny)
+
        * glib/gunicollate.c (g_utf8_collate_key): Guard against bogus
        return value from strxfrm(). For instance Microsoft's strxfrm()
        returns INT_MAX on errors. (#141124)
index bd25605..77d73c4 100644 (file)
@@ -1,5 +1,9 @@
 2004-08-21  Tor Lillqvist  <tml@iki.fi>
 
+       * glib/giowin32.c (g_io_win32_finalize): Tell select_thread to
+       break out of its loop. Prevents a thread leak. (#147392, Peter
+       Zelezny)
+
        * glib/gunicollate.c (g_utf8_collate_key): Guard against bogus
        return value from strxfrm(). For instance Microsoft's strxfrm()
        returns INT_MAX on errors. (#141124)
index ea05f9c..8d43553 100644 (file)
@@ -728,7 +728,12 @@ g_io_win32_finalize (GSource *source)
 
   SetEvent (channel->data_avail_noticed_event);
   if (channel->type == G_IO_WIN32_SOCKET)
+  {
+    /* Tell select_thread() to exit */
+    channel->needs_close = 1;
+    /* Wake up select_thread() from its blocking select() */
     send (channel->reset_send, send_buffer, sizeof (send_buffer), 0);
+  }
 
   g_io_channel_unref (watch->channel);
   UNLOCK (channel->mutex);