1998-12-15 06:28:02 +01:00
|
|
|
/* GLIB - Library of useful routines for C programming
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* gthread.c: thread related functions
|
|
|
|
* Copyright 1998 Sebastian Wilhelmi; University of Karlsruhe
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 13:02:02 +02:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1998-12-15 06:28:02 +01:00
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2000-07-26 13:02:02 +02:00
|
|
|
* Lesser General Public License for more details.
|
1998-12-15 06:28:02 +01:00
|
|
|
*
|
2000-07-26 13:02:02 +02:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1998-12-15 06:28:02 +01:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
1999-02-24 07:14:27 +01:00
|
|
|
/*
|
2000-07-26 13:02:02 +02:00
|
|
|
* Modified by the GLib Team and others 1997-2000. See the AUTHORS
|
1999-02-24 07:14:27 +01:00
|
|
|
* file for a list of people on the GLib Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
2006-05-11 02:18:46 +02:00
|
|
|
* GLib at ftp://ftp.gtk.org/pub/gtk/.
|
1999-02-24 07:14:27 +01:00
|
|
|
*/
|
|
|
|
|
2006-05-11 02:18:46 +02:00
|
|
|
/*
|
1998-12-15 06:28:02 +01:00
|
|
|
* MT safe
|
|
|
|
*/
|
|
|
|
|
2011-09-01 00:00:03 +02:00
|
|
|
#include "glib.h"
|
|
|
|
|
|
|
|
#include "gthreadprivate.h"
|
|
|
|
|
1998-12-15 06:28:02 +01:00
|
|
|
void
|
2011-09-19 07:02:44 +02:00
|
|
|
g_thread_init (gpointer init)
|
1998-12-15 06:28:02 +01:00
|
|
|
{
|
2011-08-31 22:10:55 +02:00
|
|
|
static gboolean already_done;
|
1998-12-15 06:28:02 +01:00
|
|
|
|
2011-08-31 22:10:55 +02:00
|
|
|
if (init != NULL)
|
|
|
|
g_warning ("GThread system no longer supports custom thread implementations.");
|
2010-01-12 21:16:59 +01:00
|
|
|
|
2011-08-31 22:10:55 +02:00
|
|
|
if (already_done)
|
|
|
|
return;
|
2006-05-11 02:18:46 +02:00
|
|
|
|
2011-08-31 22:10:55 +02:00
|
|
|
already_done = TRUE;
|
1998-12-15 06:28:02 +01:00
|
|
|
|
2003-02-14 16:08:46 +01:00
|
|
|
g_thread_init_glib ();
|
Completed the thread support in GLib. Thread creation, prioritizing
1999-06-17 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* configure.in, acglib.m4, acconfig.h, glib.h, gthread.c:
Completed the thread support in GLib. Thread creation,
prioritizing threads, yielding, joining threads as well as
reader/writer locks and recursive mutexes are now in place. Please
test heavily on your platform. It is so far tested on
Linux/i386/pthreads, Solaris/Sparc/pthreads and
Solaris/Sparc/solaristhreads.
* gtimer.c, glib.h: Implement g_usleep (gulong microseconds) for
thread safe sleeping. (sleep() is not MT-safe at all!)
* gutils.c: Avoid compiler warning.
* tests/Makefile.am, tests/thread-test.c: New program to test some
aspects of the thread implementation.
* gthread.c, Makefile.am: Renamed from gmutex.c to reflect the
change of content.
* configure.in: Purged all appearances of nspr.
* gthread/gthread-posix.c, gthread-solaris.c: Added the native
implementations for the GLib's extended thread support.
* gthread/gthread-nspr.c: Removed for good. NSPR is nothing we
would want to build upon.
* gthread/gthread.c: Renamed to gthread-impl.c to avoid
confusion with ../gthread.c (Formerly known as the file called
gmutex.c)
* gthread/testgthread.c: Removed. The new and much extended
tests are in ../tests/thread-test.c.
* gthread/Makefile.am: Changed to reflect the changes above.
1999-06-17 17:39:31 +02:00
|
|
|
}
|
2011-08-31 22:01:09 +02:00
|
|
|
|
|
|
|
void
|
2011-09-19 07:02:44 +02:00
|
|
|
g_thread_init_with_errorcheck_mutexes (gpointer vtable)
|
2011-08-31 22:01:09 +02:00
|
|
|
{
|
|
|
|
g_assert (vtable == NULL);
|
|
|
|
|
|
|
|
g_thread_init (NULL);
|
|
|
|
}
|