Fix up some doc comments that referred to threads not being enabled

(and a few other unrelated comment fixes)
This commit is contained in:
Dan Winship 2011-10-05 11:45:51 -04:00
parent af55ff5a2b
commit 7ca83c6c9f
9 changed files with 13 additions and 28 deletions

View File

@ -102,12 +102,6 @@
* 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;

View 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.

View 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.
*

View 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.
*

View 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

View File

@ -48,9 +48,11 @@
* 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

View 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.

View 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.

View 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