2000-07-20 09:27:26 +02:00
|
|
|
/* Threads compatibility routines for libgcc2 and libobjc. */
|
1997-12-25 00:56:08 +01:00
|
|
|
/* Compile this one with gcc. */
|
2015-01-05 13:33:28 +01:00
|
|
|
/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
|
1997-12-25 00:56:08 +01:00
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
This file is part of GCC.
|
1997-12-25 00:56:08 +01:00
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free
|
2009-04-09 17:00:19 +02:00
|
|
|
Software Foundation; either version 3, or (at your option) any later
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
version.
|
1997-12-25 00:56:08 +01:00
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
GCC 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 General Public License
|
|
|
|
for more details.
|
1997-12-25 00:56:08 +01:00
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
Under Section 7 of GPL version 3, you are granted additional
|
|
|
|
permissions described in the GCC Runtime Library Exception, version
|
|
|
|
3.1, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License and
|
|
|
|
a copy of the GCC Runtime Library Exception along with this program;
|
|
|
|
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
1997-12-25 00:56:08 +01:00
|
|
|
|
2001-05-26 03:31:47 +02:00
|
|
|
#ifndef GCC_GTHR_SINGLE_H
|
|
|
|
#define GCC_GTHR_SINGLE_H
|
1997-12-25 00:56:08 +01:00
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Just provide compatibility for mutex handling. */
|
1997-12-25 00:56:08 +01:00
|
|
|
|
2008-05-05 19:42:26 +02:00
|
|
|
typedef int __gthread_key_t;
|
|
|
|
typedef int __gthread_once_t;
|
1997-12-25 00:56:08 +01:00
|
|
|
typedef int __gthread_mutex_t;
|
2004-08-28 04:33:54 +02:00
|
|
|
typedef int __gthread_recursive_mutex_t;
|
1997-12-25 00:56:08 +01:00
|
|
|
|
2008-05-05 19:42:26 +02:00
|
|
|
#define __GTHREAD_ONCE_INIT 0
|
1997-12-25 00:56:08 +01:00
|
|
|
#define __GTHREAD_MUTEX_INIT 0
|
2015-04-15 17:29:12 +02:00
|
|
|
#define __GTHREAD_MUTEX_INIT_FUNCTION(mx) do {} while (0)
|
2008-05-05 19:42:26 +02:00
|
|
|
#define __GTHREAD_RECURSIVE_MUTEX_INIT 0
|
1997-12-25 00:56:08 +01:00
|
|
|
|
2015-03-02 19:02:18 +01:00
|
|
|
#define UNUSED __attribute__((__unused__))
|
2001-03-28 06:37:36 +02:00
|
|
|
|
2000-07-20 09:27:26 +02:00
|
|
|
#ifdef _LIBOBJC
|
|
|
|
|
|
|
|
/* Thread local storage for a single thread */
|
|
|
|
static void *thread_local_storage = NULL;
|
|
|
|
|
|
|
|
/* Backend initialization functions */
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Initialize the threads subsystem. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2002-11-15 05:53:19 +01:00
|
|
|
__gthread_objc_init_thread_system (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
/* No thread support available */
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Close the threads subsystem. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2002-11-15 05:53:19 +01:00
|
|
|
__gthread_objc_close_thread_system (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
/* No thread support available */
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Backend thread functions */
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Create a new thread of execution. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline objc_thread_t
|
2008-05-05 19:42:26 +02:00
|
|
|
__gthread_objc_thread_detach (void (* func)(void *), void * arg UNUSED)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
/* No thread support available */
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Set the current thread's priority. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2008-05-05 19:42:26 +02:00
|
|
|
__gthread_objc_thread_set_priority (int priority UNUSED)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
/* No thread support available */
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Return the current thread's priority. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2002-11-15 05:53:19 +01:00
|
|
|
__gthread_objc_thread_get_priority (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
return OBJC_THREAD_INTERACTIVE_PRIORITY;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Yield our process time to another thread. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline void
|
2002-11-15 05:53:19 +01:00
|
|
|
__gthread_objc_thread_yield (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Terminate the current thread. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2002-11-15 05:53:19 +01:00
|
|
|
__gthread_objc_thread_exit (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
/* No thread support available */
|
|
|
|
/* Should we really exit the program */
|
2002-11-15 05:53:19 +01:00
|
|
|
/* exit (&__objc_thread_exit_status); */
|
2000-07-20 09:27:26 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Returns an integer value which uniquely describes a thread. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline objc_thread_t
|
2002-11-15 05:53:19 +01:00
|
|
|
__gthread_objc_thread_id (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
2001-10-12 15:10:33 +02:00
|
|
|
/* No thread support, use 1. */
|
2002-11-15 05:53:19 +01:00
|
|
|
return (objc_thread_t) 1;
|
2000-07-20 09:27:26 +02:00
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Sets the thread's local storage pointer. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2002-11-15 05:53:19 +01:00
|
|
|
__gthread_objc_thread_set_data (void *value)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
thread_local_storage = value;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Returns the thread's local storage pointer. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline void *
|
2002-11-15 05:53:19 +01:00
|
|
|
__gthread_objc_thread_get_data (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
return thread_local_storage;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Backend mutex functions */
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Allocate a mutex. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2008-05-05 19:42:26 +02:00
|
|
|
__gthread_objc_mutex_allocate (objc_mutex_t mutex UNUSED)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Deallocate a mutex. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2008-05-05 19:42:26 +02:00
|
|
|
__gthread_objc_mutex_deallocate (objc_mutex_t mutex UNUSED)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Grab a lock on a mutex. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2008-05-05 19:42:26 +02:00
|
|
|
__gthread_objc_mutex_lock (objc_mutex_t mutex UNUSED)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
/* There can only be one thread, so we always get the lock */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Try to grab a lock on a mutex. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2008-05-05 19:42:26 +02:00
|
|
|
__gthread_objc_mutex_trylock (objc_mutex_t mutex UNUSED)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
/* There can only be one thread, so we always get the lock */
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Unlock the mutex */
|
|
|
|
static inline int
|
2008-05-05 19:42:26 +02:00
|
|
|
__gthread_objc_mutex_unlock (objc_mutex_t mutex UNUSED)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Backend condition mutex functions */
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Allocate a condition. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2008-05-05 19:42:26 +02:00
|
|
|
__gthread_objc_condition_allocate (objc_condition_t condition UNUSED)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Deallocate a condition. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2008-05-05 19:42:26 +02:00
|
|
|
__gthread_objc_condition_deallocate (objc_condition_t condition UNUSED)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Wait on the condition */
|
|
|
|
static inline int
|
2008-05-05 19:42:26 +02:00
|
|
|
__gthread_objc_condition_wait (objc_condition_t condition UNUSED,
|
|
|
|
objc_mutex_t mutex UNUSED)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Wake up all threads waiting on this condition. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2008-05-05 19:42:26 +02:00
|
|
|
__gthread_objc_condition_broadcast (objc_condition_t condition UNUSED)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Wake up one thread waiting on this condition. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
2008-05-05 19:42:26 +02:00
|
|
|
__gthread_objc_condition_signal (objc_condition_t condition UNUSED)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else /* _LIBOBJC */
|
|
|
|
|
1997-12-25 00:56:08 +01:00
|
|
|
static inline int
|
gthr-single.h (__gthread_active_p): Add prototype arguments.
* gthr-single.h (__gthread_active_p): Add prototype arguments.
* libgcc2.c (__udivmoddi4): Remove unnecessary decls.
(__dummy, __builtin_saveregs, __bb_exit_trace_func, __bb_init_prg,
__bb_trace_func, __bb_trace_func_ret, __bb_trace_ret,
function_ptr, getpagesize, __enable_execute_stack,
__enable_execute_stack, __clear_insn_cache,
__enable_execute_stack, __do_global_dtors, __do_global_ctors,
_cleanup, _exit, __default_terminate, __terminate_func,
__terminate, __empty, __throw, new_eh_context,
eh_context_initialize, eh_context_static, eh_context_specific,
get_eh_context, __get_eh_context, __get_eh_info,
init_reg_size_table, eh_threads_initialize,
__get_dynamic_handler_chain, __sjthrow, __sjpopnthrow,
__unwinding_cleanup, throw_helper, __throw, __rethrow,
__pure_virtual): Add prototype arguments.
(__bb_exit_func): Cast a sizeof to long when comparing against one.
Cast a signed value to unsigned long when comparing against one.
(new_eh_context): Wrap in _GTHREADS macro.
(__sjthrow, __sjpopnthrow): Initialize variable `cleanup' at
declaration.
(in_reg_window): Mark parameters with __attribute__ ((__unused__)).
(throw_helper): Initialize variables `handler_p' and `pc_p'.
From-SVN: r30872
1999-12-12 16:34:09 +01:00
|
|
|
__gthread_active_p (void)
|
1997-12-25 00:56:08 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-11-25 11:55:54 +01:00
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_once (__gthread_once_t *__once UNUSED, void (*__func) (void) UNUSED)
|
2008-05-05 19:42:26 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2008-05-05 19:42:26 +02:00
|
|
|
static inline int UNUSED
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_key_create (__gthread_key_t *__key UNUSED, void (*__func) (void *) UNUSED)
|
2008-05-05 19:42:26 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int UNUSED
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_key_delete (__gthread_key_t __key UNUSED)
|
2008-05-05 19:42:26 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2008-05-05 19:42:26 +02:00
|
|
|
static inline void *
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_getspecific (__gthread_key_t __key UNUSED)
|
2008-05-05 19:42:26 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-11-25 11:55:54 +01:00
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_setspecific (__gthread_key_t __key UNUSED, const void *__v UNUSED)
|
2008-05-05 19:42:26 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-03-01 11:46:31 +01:00
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_mutex_destroy (__gthread_mutex_t *__mutex UNUSED)
|
2008-03-01 11:46:31 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1997-12-25 00:56:08 +01:00
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_mutex_lock (__gthread_mutex_t *__mutex UNUSED)
|
1997-12-25 00:56:08 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_mutex_trylock (__gthread_mutex_t *__mutex UNUSED)
|
1997-12-25 00:56:08 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_mutex_unlock (__gthread_mutex_t *__mutex UNUSED)
|
1997-12-25 00:56:08 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-08-28 04:33:54 +02:00
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
|
2004-08-28 04:33:54 +02:00
|
|
|
{
|
2009-02-16 13:19:34 +01:00
|
|
|
return __gthread_mutex_lock (__mutex);
|
2004-08-28 04:33:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
|
2004-08-28 04:33:54 +02:00
|
|
|
{
|
2009-02-16 13:19:34 +01:00
|
|
|
return __gthread_mutex_trylock (__mutex);
|
2004-08-28 04:33:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
|
2004-08-28 04:33:54 +02:00
|
|
|
{
|
2009-02-16 13:19:34 +01:00
|
|
|
return __gthread_mutex_unlock (__mutex);
|
2004-08-28 04:33:54 +02:00
|
|
|
}
|
|
|
|
|
2012-10-02 22:22:32 +02:00
|
|
|
static inline int
|
|
|
|
__gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex)
|
|
|
|
{
|
|
|
|
return __gthread_mutex_destroy (__mutex);
|
|
|
|
}
|
|
|
|
|
2000-07-20 09:27:26 +02:00
|
|
|
#endif /* _LIBOBJC */
|
|
|
|
|
2001-03-28 06:37:36 +02:00
|
|
|
#undef UNUSED
|
|
|
|
|
2001-05-26 03:31:47 +02:00
|
|
|
#endif /* ! GCC_GTHR_SINGLE_H */
|