make struct _GThread private
[platform/upstream/glib.git] / glib / gthreadprivate.h
1 /* GLIB - Library of useful routines for C programming
2  *
3  * gthreadprivate.h - GLib internal thread system related declarations.
4  *
5  *  Copyright (C) 2003 Sebastian Wilhelmi
6  *
7  * The Gnome Library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * The Gnome Library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with the Gnome Library; see the file COPYING.LIB.  If not,
19  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  *   Boston, MA 02111-1307, USA.
21  */
22
23 #ifndef __G_THREADPRIVATE_H__
24 #define __G_THREADPRIVATE_H__
25
26 #include "deprecated/gthread.h"
27
28 struct  _GThread
29 {
30   /*< private >*/
31   GThreadFunc func;
32   gpointer data;
33   gboolean joinable;
34   GThreadPriority priority;
35 };
36
37 typedef struct _GRealThread GRealThread;
38 struct  _GRealThread
39 {
40   GThread thread;
41
42   gint ref_count;
43   gboolean ours;
44   const gchar *name;
45   gpointer retval;
46 };
47
48 /* system thread implementation (gthread-posix.c, gthread-win32.c) */
49 G_GNUC_INTERNAL
50 void            g_system_thread_wait            (GRealThread  *thread);
51
52 G_GNUC_INTERNAL
53 GRealThread *   g_system_thread_new             (GThreadFunc   func,
54                                                  gulong        stack_size,
55                                                  GError      **error);
56 G_GNUC_INTERNAL
57 void            g_system_thread_free            (GRealThread  *thread);
58
59 G_GNUC_INTERNAL
60 void            g_system_thread_exit            (void);
61 G_GNUC_INTERNAL
62 void            g_system_thread_set_name        (const gchar  *name);
63
64
65 /* gthread.c */
66 G_GNUC_INTERNAL
67 GThread *       g_thread_new_internal           (const gchar  *name,
68                                                  GThreadFunc   proxy,
69                                                  GThreadFunc   func,
70                                                  gpointer      data,
71                                                  gsize         stack_size,
72                                                  GError      **error);
73
74 G_GNUC_INTERNAL
75 gpointer        g_thread_proxy                  (gpointer      thread);
76
77 #endif /* __G_THREADPRIVATE_H__ */