2000-07-20 09:27:26 +02:00
|
|
|
/* Threads compatibility routines for libgcc2 and libobjc for VxWorks. */
|
1998-04-03 01:15:06 +02:00
|
|
|
/* Compile this one with gcc. */
|
2015-01-05 13:33:28 +01:00
|
|
|
/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
|
1998-04-03 01:15:06 +02:00
|
|
|
Contributed by Mike Stump <mrs@wrs.com>.
|
|
|
|
|
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.
|
1998-04-03 01:15:06 +02: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.
|
1998-04-03 01:15:06 +02: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.
|
1998-04-03 01:15:06 +02: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.
|
1998-04-03 01:15:06 +02:00
|
|
|
|
2009-04-09 17:00:19 +02:00
|
|
|
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/>. */
|
1998-04-03 01:15:06 +02:00
|
|
|
|
2001-05-26 03:31:47 +02:00
|
|
|
#ifndef GCC_GTHR_VXWORKS_H
|
|
|
|
#define GCC_GTHR_VXWORKS_H
|
1998-04-03 01:15:06 +02:00
|
|
|
|
2000-07-20 09:27:26 +02:00
|
|
|
#ifdef _LIBOBJC
|
|
|
|
|
2002-12-16 19:23:00 +01:00
|
|
|
/* libobjc requires the optional pthreads component. */
|
2011-11-07 17:34:31 +01:00
|
|
|
#include "gthr-posix.h"
|
2000-07-20 09:27:26 +02:00
|
|
|
|
2002-12-16 19:23:00 +01:00
|
|
|
#else
|
2008-03-24 12:18:22 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
#define UNUSED(x)
|
|
|
|
#else
|
2015-03-02 19:02:18 +01:00
|
|
|
#define UNUSED(x) x __attribute__((__unused__))
|
2008-03-24 12:18:22 +01:00
|
|
|
#endif
|
1998-04-03 01:15:06 +02:00
|
|
|
|
2007-03-14 14:58:21 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
1998-04-03 01:15:06 +02:00
|
|
|
#define __GTHREADS 1
|
2002-12-16 19:23:00 +01:00
|
|
|
#define __gthread_active_p() 1
|
|
|
|
|
|
|
|
/* Mutexes are easy, except that they need to be initialized at runtime. */
|
1998-04-03 01:15:06 +02:00
|
|
|
|
|
|
|
#include <semLib.h>
|
|
|
|
|
|
|
|
typedef SEM_ID __gthread_mutex_t;
|
2004-08-28 04:33:54 +02:00
|
|
|
/* All VxWorks mutexes are recursive. */
|
|
|
|
typedef SEM_ID __gthread_recursive_mutex_t;
|
2002-12-16 19:23:00 +01:00
|
|
|
#define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function
|
2004-08-28 04:33:54 +02:00
|
|
|
#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
|
1998-04-03 01:15:06 +02:00
|
|
|
|
2002-12-16 19:23:00 +01:00
|
|
|
static inline void
|
|
|
|
__gthread_mutex_init_function (__gthread_mutex_t *mutex)
|
1998-04-03 01:15:06 +02:00
|
|
|
{
|
2002-12-16 19:23:00 +01:00
|
|
|
*mutex = semMCreate (SEM_Q_PRIORITY | SEM_INVERSION_SAFE | SEM_DELETE_SAFE);
|
1998-04-03 01:15:06 +02:00
|
|
|
}
|
|
|
|
|
2008-03-01 11:46:31 +01:00
|
|
|
static inline int
|
|
|
|
__gthread_mutex_destroy (__gthread_mutex_t * UNUSED(mutex))
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1998-04-03 01:15:06 +02:00
|
|
|
static inline int
|
|
|
|
__gthread_mutex_lock (__gthread_mutex_t *mutex)
|
|
|
|
{
|
|
|
|
return semTake (*mutex, WAIT_FOREVER);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
__gthread_mutex_trylock (__gthread_mutex_t *mutex)
|
|
|
|
{
|
|
|
|
return semTake (*mutex, NO_WAIT);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
__gthread_mutex_unlock (__gthread_mutex_t *mutex)
|
|
|
|
{
|
|
|
|
return semGive (*mutex);
|
|
|
|
}
|
|
|
|
|
2004-08-28 04:33:54 +02:00
|
|
|
static inline void
|
|
|
|
__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *mutex)
|
|
|
|
{
|
|
|
|
__gthread_mutex_init_function (mutex);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex)
|
|
|
|
{
|
|
|
|
return __gthread_mutex_lock (mutex);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex)
|
|
|
|
{
|
|
|
|
return __gthread_mutex_trylock (mutex);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex)
|
|
|
|
{
|
|
|
|
return __gthread_mutex_unlock (mutex);
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2002-12-16 19:23:00 +01:00
|
|
|
/* pthread_once is complicated enough that it's implemented
|
|
|
|
out-of-line. See config/vxlib.c. */
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2009-04-22 12:53:53 +02:00
|
|
|
#if !defined(__RTP__)
|
|
|
|
#if defined(__PPC__)
|
|
|
|
__attribute ((aligned (__alignof (unsigned))))
|
|
|
|
#endif
|
2002-12-16 19:23:00 +01:00
|
|
|
volatile unsigned char busy;
|
2007-03-14 14:58:21 +01:00
|
|
|
#endif
|
2002-12-16 19:23:00 +01:00
|
|
|
volatile unsigned char done;
|
2009-04-22 12:53:53 +02:00
|
|
|
#if !defined(__RTP__) && defined(__PPC__)
|
|
|
|
/* PPC's test-and-set implementation requires a 4 byte aligned
|
|
|
|
object, of which it only sets the first byte. We use padding
|
|
|
|
here, in order to maintain some amount of backwards
|
|
|
|
compatibility. Without this padding, gthread_once objects worked
|
|
|
|
by accident because they happen to be static objects and the ppc
|
|
|
|
port automatically increased their alignment to 4 bytes. */
|
|
|
|
unsigned char pad1;
|
|
|
|
unsigned char pad2;
|
|
|
|
#endif
|
2002-12-16 19:23:00 +01:00
|
|
|
}
|
|
|
|
__gthread_once_t;
|
|
|
|
|
2009-04-22 12:53:53 +02:00
|
|
|
#if defined (__RTP__)
|
2007-03-14 14:58:21 +01:00
|
|
|
# define __GTHREAD_ONCE_INIT { 0 }
|
2009-11-25 11:55:54 +01:00
|
|
|
#elif defined (__PPC__)
|
2009-04-22 12:53:53 +02:00
|
|
|
# define __GTHREAD_ONCE_INIT { 0, 0, 0, 0 }
|
|
|
|
#else
|
|
|
|
# define __GTHREAD_ONCE_INIT { 0, 0 }
|
2007-03-14 14:58:21 +01:00
|
|
|
#endif
|
2002-12-16 19:23:00 +01:00
|
|
|
|
2009-02-16 13:19:34 +01:00
|
|
|
extern int __gthread_once (__gthread_once_t *__once, void (*__func)(void));
|
2002-12-16 19:23:00 +01:00
|
|
|
|
|
|
|
/* Thread-specific data requires a great deal of effort, since VxWorks
|
|
|
|
is not really set up for it. See config/vxlib.c for the gory
|
|
|
|
details. All the TSD routines are sufficiently complex that they
|
|
|
|
need to be implemented out of line. */
|
|
|
|
|
|
|
|
typedef unsigned int __gthread_key_t;
|
|
|
|
|
2009-02-16 13:19:34 +01:00
|
|
|
extern int __gthread_key_create (__gthread_key_t *__keyp, void (*__dtor)(void *));
|
|
|
|
extern int __gthread_key_delete (__gthread_key_t __key);
|
2002-12-16 19:23:00 +01:00
|
|
|
|
2009-02-16 13:19:34 +01:00
|
|
|
extern void *__gthread_getspecific (__gthread_key_t __key);
|
|
|
|
extern int __gthread_setspecific (__gthread_key_t __key, void *__ptr);
|
2002-12-16 19:23:00 +01:00
|
|
|
|
2008-03-24 12:18:22 +01:00
|
|
|
#undef UNUSED
|
|
|
|
|
2007-03-14 14:58:21 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-12-16 19:23:00 +01:00
|
|
|
#endif /* not _LIBOBJC */
|
2000-07-20 09:27:26 +02:00
|
|
|
|
2002-12-16 19:23:00 +01:00
|
|
|
#endif /* gthr-vxworks.h */
|