Make g_io_channel_ref(), g_main_context_ref(), g_hook_ref(),

2004-11-08  Matthias Clasen  <mclasen@redhat.com>

	* glib/gasyncqueue.[hc]:
	* glib/ghook.[hc]:
	* glib/gmain.[hc]:
	* glib/giochannel.[hc]: Make g_io_channel_ref(),
	g_main_context_ref(), g_hook_ref(), g_async_queue_ref()
	return the passed in pointer. (#151663, Manish Singh)
This commit is contained in:
Matthias Clasen 2004-11-08 18:26:56 +00:00 committed by Matthias Clasen
parent 0631238743
commit c83e52605f
16 changed files with 65 additions and 15 deletions

View File

@ -1,5 +1,12 @@
2004-11-08 Matthias Clasen <mclasen@redhat.com> 2004-11-08 Matthias Clasen <mclasen@redhat.com>
* glib/gasyncqueue.[hc]:
* glib/ghook.[hc]:
* glib/gmain.[hc]:
* glib/giochannel.[hc]: Make g_io_channel_ref(),
g_main_context_ref(), g_hook_ref(), g_async_queue_ref()
return the passed in pointer. (#151663, Manish Singh)
* glib/gmain.c: Initialize child_watch_count to 1, so * glib/gmain.c: Initialize child_watch_count to 1, so
that we don't miss the very first child if it exits that we don't miss the very first child if it exits
before we set up the child watch. In that case we had before we set up the child watch. In that case we had

View File

@ -1,5 +1,12 @@
2004-11-08 Matthias Clasen <mclasen@redhat.com> 2004-11-08 Matthias Clasen <mclasen@redhat.com>
* glib/gasyncqueue.[hc]:
* glib/ghook.[hc]:
* glib/gmain.[hc]:
* glib/giochannel.[hc]: Make g_io_channel_ref(),
g_main_context_ref(), g_hook_ref(), g_async_queue_ref()
return the passed in pointer. (#151663, Manish Singh)
* glib/gmain.c: Initialize child_watch_count to 1, so * glib/gmain.c: Initialize child_watch_count to 1, so
that we don't miss the very first child if it exits that we don't miss the very first child if it exits
before we set up the child watch. In that case we had before we set up the child watch. In that case we had

View File

@ -1,5 +1,12 @@
2004-11-08 Matthias Clasen <mclasen@redhat.com> 2004-11-08 Matthias Clasen <mclasen@redhat.com>
* glib/gasyncqueue.[hc]:
* glib/ghook.[hc]:
* glib/gmain.[hc]:
* glib/giochannel.[hc]: Make g_io_channel_ref(),
g_main_context_ref(), g_hook_ref(), g_async_queue_ref()
return the passed in pointer. (#151663, Manish Singh)
* glib/gmain.c: Initialize child_watch_count to 1, so * glib/gmain.c: Initialize child_watch_count to 1, so
that we don't miss the very first child if it exits that we don't miss the very first child if it exits
before we set up the child watch. In that case we had before we set up the child watch. In that case we had

View File

@ -1,5 +1,12 @@
2004-11-08 Matthias Clasen <mclasen@redhat.com> 2004-11-08 Matthias Clasen <mclasen@redhat.com>
* glib/gasyncqueue.[hc]:
* glib/ghook.[hc]:
* glib/gmain.[hc]:
* glib/giochannel.[hc]: Make g_io_channel_ref(),
g_main_context_ref(), g_hook_ref(), g_async_queue_ref()
return the passed in pointer. (#151663, Manish Singh)
* glib/gmain.c: Initialize child_watch_count to 1, so * glib/gmain.c: Initialize child_watch_count to 1, so
that we don't miss the very first child if it exits that we don't miss the very first child if it exits
before we set up the child watch. In that case we had before we set up the child watch. In that case we had

View File

@ -1,5 +1,12 @@
2004-11-08 Matthias Clasen <mclasen@redhat.com> 2004-11-08 Matthias Clasen <mclasen@redhat.com>
* glib/gasyncqueue.[hc]:
* glib/ghook.[hc]:
* glib/gmain.[hc]:
* glib/giochannel.[hc]: Make g_io_channel_ref(),
g_main_context_ref(), g_hook_ref(), g_async_queue_ref()
return the passed in pointer. (#151663, Manish Singh)
* glib/gmain.c: Initialize child_watch_count to 1, so * glib/gmain.c: Initialize child_watch_count to 1, so
that we don't miss the very first child if it exits that we don't miss the very first child if it exits
before we set up the child watch. In that case we had before we set up the child watch. In that case we had

View File

@ -1,3 +1,8 @@
2004-11-08 Matthias Clasen <mclasen@redhat.com>
* glib/tmpl/hooks.sgml:
* glib/tmpl/iochannels.sgml: Updates
2004-11-04 Tor Lillqvist <tml@iki.fi> 2004-11-04 Tor Lillqvist <tml@iki.fi>
* glib/tmpl/windows.sgml: Improve G_WIN32_HAVE_WIDECHAR_API * glib/tmpl/windows.sgml: Improve G_WIN32_HAVE_WIDECHAR_API

View File

@ -417,7 +417,7 @@ Increments the reference count for a #GHook.
@hook_list: a #GHookList. @hook_list: a #GHookList.
@hook: the #GHook to increment the reference count of. @hook: the #GHook to increment the reference count of.
@returns: the @hook that was passed in (since 2.6)
<!-- ##### FUNCTION g_hook_unref ##### --> <!-- ##### FUNCTION g_hook_unref ##### -->
<para> <para>

View File

@ -301,7 +301,7 @@ Increments the reference count of a #GIOChannel.
</para> </para>
@channel: a #GIOChannel. @channel: a #GIOChannel.
@Returns: the @channel that was passed in (since 2.6)
<!-- ##### FUNCTION g_io_channel_unref ##### --> <!-- ##### FUNCTION g_io_channel_unref ##### -->
<para> <para>

View File

@ -64,14 +64,18 @@ g_async_queue_new (void)
* *
* Increases the reference count of the asynchronous @queue by 1. You * Increases the reference count of the asynchronous @queue by 1. You
* do not need to hold the lock to call this function. * do not need to hold the lock to call this function.
*
* Returns: the @queue that was passed in (since 2.6)
**/ **/
void GAsyncQueue *
g_async_queue_ref (GAsyncQueue *queue) g_async_queue_ref (GAsyncQueue *queue)
{ {
g_return_if_fail (queue); g_return_if_fail (queue);
g_return_if_fail (g_atomic_int_get (&queue->ref_count) > 0); g_return_if_fail (g_atomic_int_get (&queue->ref_count) > 0);
g_atomic_int_inc (&queue->ref_count); g_atomic_int_inc (&queue->ref_count);
return queue;
} }
/** /**

View File

@ -47,7 +47,7 @@ void g_async_queue_lock (GAsyncQueue *queue);
void g_async_queue_unlock (GAsyncQueue *queue); void g_async_queue_unlock (GAsyncQueue *queue);
/* Ref and unref the GAsyncQueue. */ /* Ref and unref the GAsyncQueue. */
void g_async_queue_ref (GAsyncQueue *queue); GAsyncQueue* g_async_queue_ref (GAsyncQueue *queue);
void g_async_queue_unref (GAsyncQueue *queue); void g_async_queue_unref (GAsyncQueue *queue);
#ifndef G_DISABLE_DEPRECATED #ifndef G_DISABLE_DEPRECATED
/* You don't have to hold the lock for calling *_ref and *_unref anymore. */ /* You don't have to hold the lock for calling *_ref and *_unref anymore. */

View File

@ -222,7 +222,7 @@ g_hook_unref (GHookList *hook_list,
} }
} }
void GHook *
g_hook_ref (GHookList *hook_list, g_hook_ref (GHookList *hook_list,
GHook *hook) GHook *hook)
{ {
@ -231,6 +231,8 @@ g_hook_ref (GHookList *hook_list,
g_return_if_fail (hook->ref_count > 0); g_return_if_fail (hook->ref_count > 0);
hook->ref_count++; hook->ref_count++;
return hook;
} }
void void

View File

@ -105,7 +105,7 @@ void g_hook_list_clear (GHookList *hook_list);
GHook* g_hook_alloc (GHookList *hook_list); GHook* g_hook_alloc (GHookList *hook_list);
void g_hook_free (GHookList *hook_list, void g_hook_free (GHookList *hook_list,
GHook *hook); GHook *hook);
void g_hook_ref (GHookList *hook_list, GHook * g_hook_ref (GHookList *hook_list,
GHook *hook); GHook *hook);
void g_hook_unref (GHookList *hook_list, void g_hook_unref (GHookList *hook_list,
GHook *hook); GHook *hook);

View File

@ -91,12 +91,14 @@ g_io_channel_init (GIOChannel *channel)
channel->close_on_unref = FALSE; channel->close_on_unref = FALSE;
} }
void GIOChannel *
g_io_channel_ref (GIOChannel *channel) g_io_channel_ref (GIOChannel *channel)
{ {
g_return_if_fail (channel != NULL); g_return_if_fail (channel != NULL);
channel->ref_count++; channel->ref_count++;
return channel;
} }
void void

View File

@ -163,7 +163,7 @@ struct _GIOFuncs
}; };
void g_io_channel_init (GIOChannel *channel); void g_io_channel_init (GIOChannel *channel);
void g_io_channel_ref (GIOChannel *channel); GIOChannel *g_io_channel_ref (GIOChannel *channel);
void g_io_channel_unref (GIOChannel *channel); void g_io_channel_unref (GIOChannel *channel);
#ifndef G_DISABLE_DEPRECATED #ifndef G_DISABLE_DEPRECATED

View File

@ -589,8 +589,10 @@ g_poll (GPollFD *fds,
* @context: a #GMainContext * @context: a #GMainContext
* *
* Increases the reference count on a #GMainContext object by one. * Increases the reference count on a #GMainContext object by one.
*
* Returns: the @context that was passed in (since 2.6)
**/ **/
void GMainContext *
g_main_context_ref (GMainContext *context) g_main_context_ref (GMainContext *context)
{ {
g_return_if_fail (context != NULL); g_return_if_fail (context != NULL);

View File

@ -136,7 +136,7 @@ struct _GPollFD
/* GMainContext: */ /* GMainContext: */
GMainContext *g_main_context_new (void); GMainContext *g_main_context_new (void);
void g_main_context_ref (GMainContext *context); GMainContext *g_main_context_ref (GMainContext *context);
void g_main_context_unref (GMainContext *context); void g_main_context_unref (GMainContext *context);
GMainContext *g_main_context_default (void); GMainContext *g_main_context_default (void);