Fix up some doc comments that referred to threads not being enabled
authorDan Winship <danw@gnome.org>
Wed, 5 Oct 2011 15:45:51 +0000 (11:45 -0400)
committerDan Winship <danw@gnome.org>
Wed, 5 Oct 2011 15:54:36 +0000 (11:54 -0400)
(and a few other unrelated comment fixes)

gio/gasyncresult.c
gio/gioscheduler.c
gio/giotypes.h
gio/gresolver.c
gio/gsimpleasyncresult.c
gio/gsocketservice.c
glib/glib-unix.c
glib/gmain.c
glib/gthreadpool.c

index b23b456..adf6f9c 100644 (file)
  * The callback for an asynchronous operation is called only once, and is
  * always called, even in the case of a cancelled operation. On cancellation
  * the result is a %G_IO_ERROR_CANCELLED error.
- *
- * Some asynchronous operations are implemented using synchronous calls.
- * These are run in a separate thread, if #GThread has been initialized, but
- * otherwise they are sent to the Main Event Loop and processed in an idle
- * function. So, if you truly need asynchronous operations, make sure to
- * initialize #GThread.
  **/
 
 typedef GAsyncResultIface GAsyncResultInterface;
index e75e330..6e669c7 100644 (file)
@@ -194,7 +194,7 @@ io_job_thread (gpointer data,
  * of the request.
  * @cancellable: optional #GCancellable object, %NULL to ignore.
  *
- * Schedules the I/O job to run
+ * Schedules the I/O job to run in another thread.
  *
  * @notify will be called on @user_data after @job_func has returned,
  * regardless whether the job was cancelled or has run to completion.
index e34164d..d37bcef 100644 (file)
@@ -196,7 +196,7 @@ typedef struct _GTcpWrapperConnection                       GTcpWrapperConnectio
 /**
  * GThreadedSocketService:
  *
- * A helper class for handling accepting incomming connections in the
+ * A helper class for handling accepting incoming connections in the
  * glib mainloop and handling them in a thread.
  *
  * Since: 2.22
@@ -286,10 +286,6 @@ typedef gboolean (* GFileReadMoreCallback) (const char *file_contents,
  *
  * I/O Job function.
  *
- * Note that depending on whether threads are available, the
- * #GIOScheduler may run jobs in separate threads or in an idle
- * in the mainloop.
- *
  * Long-running jobs should periodically check the @cancellable
  * to see if they have been cancelled.
  *
index 433b23d..ad06974 100644 (file)
@@ -139,8 +139,7 @@ static GResolver *default_resolver;
  *
  * Gets the default #GResolver. You should unref it when you are done
  * with it. #GResolver may use its reference count as a hint about how
- * many threads/processes, etc it should allocate for concurrent DNS
- * resolutions.
+ * many threads it should allocate for concurrent DNS resolutions.
  *
  * Return value: (transfer full): the default #GResolver.
  *
index ddffef1..389d3c1 100644 (file)
@@ -88,7 +88,7 @@
  * cause a leak if cancelled before being run).
  *
  * GSimpleAsyncResult can integrate into GLib's event loop, #GMainLoop,
- * or it can use #GThread<!-- -->s if available.
+ * or it can use #GThread<!-- -->s.
  * g_simple_async_result_complete() will finish an I/O task directly
  * from the point where it is called. g_simple_async_result_complete_in_idle()
  * will finish it from an idle handler in the <link
index 96a4342..2318107 100644 (file)
  * If you are interested in writing connection handlers that contain
  * blocking code then see #GThreadedSocketService.
  *
- * The socket service runs on the main loop in the main thread, and is
- * not threadsafe in general. However, the calls to start and stop
- * the service are threadsafe so these can be used from threads that
+ * The socket service runs on the main loop of the <link
+ * linkend="g-main-context-push-thread-default-context">thread-default
+ * context</link> of the thread it is created in, and is not
+ * threadsafe in general. However, the calls to start and stop the
+ * service are thread-safe so these can be used from threads that
  * handle incoming clients.
  *
  * Since: 2.22
@@ -172,7 +174,7 @@ g_socket_service_is_active (GSocketService *service)
  * Starts the service, i.e. start accepting connections
  * from the added sockets when the mainloop runs.
  *
- * This call is threadsafe, so it may be called from a thread
+ * This call is thread-safe, so it may be called from a thread
  * handling an incoming client request.
  *
  * Since: 2.22
@@ -202,7 +204,7 @@ g_socket_service_start (GSocketService *service)
  * Stops the service, i.e. stops accepting connections
  * from the added sockets when the mainloop runs.
  *
- * This call is threadsafe, so it may be called from a thread
+ * This call is thread-safe, so it may be called from a thread
  * handling an incoming client request.
  *
  * Since: 2.22
index 2654f0e..838d1e2 100644 (file)
@@ -200,12 +200,6 @@ g_unix_set_fd_nonblocking (gint       fd,
  * The interaction of this source when combined with native UNIX
  * functions like sigprocmask() is not defined.
  *
- * <note>For reliable behavior, if your program links to gthread
- * (either directly or indirectly via GObject, GIO, or a higher level
- * library), you should ensure g_thread_init() is called before using
- * this function.  For example, if your program uses GObject, call
- * g_type_init().</note>
- *
  * The source will not initially be associated with any #GMainContext
  * and must be added to one with g_source_attach() before it will be
  * executed.
index 6c31a5d..fe63b40 100644 (file)
@@ -723,7 +723,7 @@ g_main_context_pop_thread_default (GMainContext *context)
  * add their #GSource<!-- -->s to. (Note that even in single-threaded
  * programs applications may sometimes want to temporarily push a
  * non-default context, so it is not safe to assume that this will
- * always return %NULL if threads are not initialized.)
+ * always return %NULL if you are running in the default thread.)
  *
  * Returns: (transfer none): the thread-default #GMainContext, or
  * %NULL if the thread-default context is the global default context.
index 28d609f..0e2340e 100644 (file)
@@ -1,7 +1,7 @@
 /* GLIB - Library of useful routines for C programming
  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
  *
- * GAsyncQueue: thread pool implementation.
+ * GThreadPool: thread pool implementation.
  * Copyright (C) 2000 Sebastian Wilhelmi; University of Karlsruhe
  *
  * This library is free software; you can redistribute it and/or