* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* Authors: Ryan Lortie <desrt@desrt.ca>
* Alexander Larsson <alexl@redhat.com>
* SECTION:gthreadedsocketservice
* @title: GThreadedSocketService
* @short_description: A threaded GSocketService
+ * @include: gio/gio.h
* @see_also: #GSocketService.
*
* A #GThreadedSocketService is a simple subclass of #GSocketService
typedef struct
{
- GThreadedSocketService *service;
GSocketConnection *connection;
GObject *source_object;
} GThreadedSocketServiceData;
GThreadedSocketServiceData *data = _data;
gboolean result;
- g_signal_emit (data->service, g_threaded_socket_service_run_signal,
+ g_signal_emit (threaded, g_threaded_socket_service_run_signal,
0, data->connection, data->source_object, &result);
- g_object_unref (data->service);
g_object_unref (data->connection);
if (data->source_object)
g_object_unref (data->source_object);
if (threaded->priv->job_count-- == threaded->priv->max_threads)
g_socket_service_start (G_SOCKET_SERVICE (threaded));
G_UNLOCK (job_count);
+
+ g_object_unref (threaded);
}
static gboolean
threaded = G_THREADED_SOCKET_SERVICE (service);
data = g_slice_new (GThreadedSocketServiceData);
- data->service = g_object_ref (service);
+
+ /* Ref the socket service for the thread */
+ g_object_ref (service);
+
data->connection = g_object_ref (connection);
if (source_object)
data->source_object = g_object_ref (source_object);
static void
g_threaded_socket_service_init (GThreadedSocketService *service)
{
- service->priv = g_threaded_socket_service_get_private (service);
+ service->priv = g_threaded_socket_service_get_instance_private (service);
service->priv->max_threads = 10;
}
{
GThreadedSocketService *service = G_THREADED_SOCKET_SERVICE (object);
- g_thread_pool_free (service->priv->thread_pool, FALSE, TRUE);
+ g_thread_pool_free (service->priv->thread_pool, FALSE, FALSE);
G_OBJECT_CLASS (g_threaded_socket_service_parent_class)
->finalize (object);