gnetworking.h.in: move "#undef interface"
[platform/upstream/glib.git] / gio / gthreadedsocketservice.c
index 475c1e1..f18238c 100644 (file)
@@ -14,9 +14,7 @@
  * 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>
@@ -26,6 +24,7 @@
  * SECTION:gthreadedsocketservice
  * @title: GThreadedSocketService
  * @short_description: A threaded GSocketService
+ * @include: gio/gio.h
  * @see_also: #GSocketService.
  *
  * A #GThreadedSocketService is a simple subclass of #GSocketService
 #include "gthreadedsocketservice.h"
 #include "glibintl.h"
 
+struct _GThreadedSocketServicePrivate
+{
+  GThreadPool *thread_pool;
+  int max_threads;
+  gint job_count;
+};
 
 static guint g_threaded_socket_service_run_signal;
 
-G_DEFINE_TYPE (GThreadedSocketService,
-              g_threaded_socket_service,
-              G_TYPE_SOCKET_SERVICE);
+G_DEFINE_TYPE_WITH_PRIVATE (GThreadedSocketService,
+                            g_threaded_socket_service,
+                            G_TYPE_SOCKET_SERVICE)
 
 enum
 {
@@ -63,16 +68,8 @@ enum
   PROP_MAX_THREADS
 };
 
-
 G_LOCK_DEFINE_STATIC(job_count);
 
-struct _GThreadedSocketServicePrivate
-{
-  GThreadPool *thread_pool;
-  int max_threads;
-  gint job_count;
-};
-
 typedef struct
 {
   GThreadedSocketService *service;
@@ -136,9 +133,7 @@ g_threaded_socket_service_incoming (GSocketService    *service,
 static void
 g_threaded_socket_service_init (GThreadedSocketService *service)
 {
-  service->priv = G_TYPE_INSTANCE_GET_PRIVATE (service,
-                                              G_TYPE_THREADED_SOCKET_SERVICE,
-                                              GThreadedSocketServicePrivate);
+  service->priv = g_threaded_socket_service_get_instance_private (service);
   service->priv->max_threads = 10;
 }
 
@@ -212,8 +207,6 @@ g_threaded_socket_service_class_init (GThreadedSocketServiceClass *class)
   GObjectClass *gobject_class = G_OBJECT_CLASS (class);
   GSocketServiceClass *ss_class = &class->parent_class;
 
-  g_type_class_add_private (class, sizeof (GThreadedSocketServicePrivate));
-
   gobject_class->constructed = g_threaded_socket_service_constructed;
   gobject_class->finalize = g_threaded_socket_service_finalize;
   gobject_class->set_property = g_threaded_socket_service_set_property;