gthreadprivate.h 2.3 KB
Newer Older
1 2 3
/* GLIB - Library of useful routines for C programming
 *
 * gthreadprivate.h - GLib internal thread system related declarations.
4 5 6
 *
 *  Copyright (C) 2003 Sebastian Wilhelmi
 *
7 8 9
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
10
 * version 2.1 of the License, or (at your option) any later version.
11
 *
12
 * This library is distributed in the hope that it will be useful,
13 14 15 16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
17 18
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library; if not, see <http://www.gnu.org/licenses/>.
19 20
 */

21 22
#ifndef __G_THREADPRIVATE_H__
#define __G_THREADPRIVATE_H__
23

24
#include "deprecated/gthread.h"
25

26
typedef struct _GRealThread GRealThread;
27 28 29
struct  _GRealThread
{
  GThread thread;
30

31 32
  gint ref_count;
  gboolean ours;
33
  gchar *name;
34 35 36 37
  gpointer retval;
};

/* system thread implementation (gthread-posix.c, gthread-win32.c) */
38
void            g_system_thread_wait            (GRealThread  *thread);
39

40 41 42
GRealThread *   g_system_thread_new             (GThreadFunc   func,
                                                 gulong        stack_size,
                                                 GError      **error);
43
void            g_system_thread_free            (GRealThread  *thread);
44

45 46 47
void            g_system_thread_exit            (void);
void            g_system_thread_set_name        (const gchar  *name);

48

49
/* gthread.c */
50 51 52 53 54 55
GThread *       g_thread_new_internal           (const gchar  *name,
                                                 GThreadFunc   proxy,
                                                 GThreadFunc   func,
                                                 gpointer      data,
                                                 gsize         stack_size,
                                                 GError      **error);
56

57
gpointer        g_thread_proxy                  (gpointer      thread);
58

59 60 61
gpointer        g_private_set_alloc0            (GPrivate       *key,
                                                 gsize           size);

62
#endif /* __G_THREADPRIVATE_H__ */