2004-08-28 04:33:54 +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_DCE_H
|
|
|
|
#define GCC_GTHR_DCE_H
|
1997-12-25 00:56:08 +01:00
|
|
|
|
2001-11-30 20:47:11 +01:00
|
|
|
/* If _DCE_THREADS is not defined, then we're building the single
|
|
|
|
threaded version of the libraries and do not want to reference
|
|
|
|
anything related to pthreads or dce. */
|
|
|
|
#ifndef _DCE_THREADS
|
|
|
|
#include "gthr-single.h"
|
|
|
|
#else
|
1997-12-25 00:56:08 +01:00
|
|
|
/* DCE threads interface.
|
|
|
|
DCE threads are based on POSIX threads draft 4, and many things
|
2001-10-12 15:10:33 +02:00
|
|
|
have changed since then. */
|
1997-12-25 00:56:08 +01:00
|
|
|
|
2009-08-02 03:38:27 +02:00
|
|
|
/* Make sure CONST_CAST2 (original in system.h) is defined. */
|
|
|
|
#ifndef CONST_CAST2
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define CONST_CAST2(TOTYPE,FROMTYPE,X) (const_cast<TOTYPE> (X))
|
|
|
|
#else
|
|
|
|
#define CONST_CAST2(TOTYPE,FROMTYPE,X) ((__extension__(union {FROMTYPE _q; TOTYPE _nq;})(X))._nq)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
1997-12-25 00:56:08 +01:00
|
|
|
#define __GTHREADS 1
|
|
|
|
|
|
|
|
#include <pthread.h>
|
|
|
|
|
|
|
|
typedef pthread_key_t __gthread_key_t;
|
|
|
|
typedef pthread_once_t __gthread_once_t;
|
|
|
|
typedef pthread_mutex_t __gthread_mutex_t;
|
2004-08-28 04:33:54 +02:00
|
|
|
typedef pthread_mutex_t __gthread_recursive_mutex_t;
|
1997-12-25 00:56:08 +01:00
|
|
|
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
#define __GTHREAD_ONCE_INIT pthread_once_init
|
2001-08-04 00:13:22 +02: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
|
2001-08-04 00:13:22 +02:00
|
|
|
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
#define __GTHREAD_MUTEX_INIT_DEFAULT pthread_once_init
|
1997-12-25 00:56:08 +01:00
|
|
|
|
|
|
|
#if SUPPORTS_WEAK && GTHREAD_USE_WEAK
|
2005-11-09 21:57:30 +01:00
|
|
|
# define __gthrw(name) \
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
static __typeof(name) __gthrw_ ## name __attribute__ ((__weakref__(#name)));
|
|
|
|
# define __gthrw_(name) __gthrw_ ## name
|
2005-11-09 21:57:30 +01:00
|
|
|
#else
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
# define __gthrw(name)
|
|
|
|
# define __gthrw_(name) name
|
2005-11-09 21:57:30 +01:00
|
|
|
#endif
|
1997-12-25 00:56:08 +01:00
|
|
|
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
__gthrw(pthread_once)
|
|
|
|
__gthrw(pthread_keycreate)
|
|
|
|
__gthrw(pthread_getspecific)
|
|
|
|
__gthrw(pthread_setspecific)
|
|
|
|
__gthrw(pthread_create)
|
|
|
|
__gthrw(pthread_mutex_init)
|
2008-03-01 11:46:31 +01:00
|
|
|
__gthrw(pthread_mutex_destroy)
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
__gthrw(pthread_mutex_lock)
|
|
|
|
__gthrw(pthread_mutex_trylock)
|
|
|
|
__gthrw(pthread_mutex_unlock)
|
|
|
|
__gthrw(pthread_mutexattr_create)
|
|
|
|
__gthrw(pthread_mutexattr_setkind_np)
|
|
|
|
__gthrw(pthread_mutexattr_delete)
|
1997-12-25 00:56:08 +01:00
|
|
|
|
2000-07-20 09:27:26 +02:00
|
|
|
#ifdef _LIBOBJC
|
2002-09-27 00:25:14 +02:00
|
|
|
/* Objective-C. */
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
__gthrw(pthread_cond_broadcast)
|
|
|
|
__gthrw(pthread_cond_destroy)
|
|
|
|
__gthrw(pthread_cond_init)
|
|
|
|
__gthrw(pthread_cond_signal)
|
|
|
|
__gthrw(pthread_cond_wait)
|
|
|
|
__gthrw(pthread_exit)
|
|
|
|
|
|
|
|
#ifdef pthread_getunique_np
|
|
|
|
# define __gthrw_pthread_getunique_np pthread_getunique_np
|
|
|
|
#else
|
|
|
|
__gthrw(pthread_getunique_np)
|
|
|
|
# define __gthrw_pthread_getunique_np __gthrw_(pthread_getunique_np)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
__gthrw(pthread_mutex_destroy)
|
|
|
|
__gthrw(pthread_self)
|
|
|
|
__gthrw(pthread_yield)
|
2000-07-20 09:27:26 +02:00
|
|
|
#endif
|
|
|
|
|
2005-11-09 21:57:30 +01:00
|
|
|
#if SUPPORTS_WEAK && GTHREAD_USE_WEAK
|
|
|
|
|
1997-12-25 00:56:08 +01:00
|
|
|
static inline int
|
2000-02-12 20:19:01 +01:00
|
|
|
__gthread_active_p (void)
|
1997-12-25 00:56:08 +01:00
|
|
|
{
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
static void *const __gthread_active_ptr = (void *) &__gthrw_(pthread_create);
|
1997-12-25 00:56:08 +01:00
|
|
|
return __gthread_active_ptr != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else /* not SUPPORTS_WEAK */
|
|
|
|
|
|
|
|
static inline int
|
2000-02-12 20:19:01 +01:00
|
|
|
__gthread_active_p (void)
|
1997-12-25 00:56:08 +01:00
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* SUPPORTS_WEAK */
|
|
|
|
|
2000-07-20 09:27:26 +02:00
|
|
|
#ifdef _LIBOBJC
|
|
|
|
|
|
|
|
/* Key structure for maintaining thread specific storage */
|
|
|
|
static pthread_key_t _objc_thread_storage;
|
|
|
|
|
|
|
|
/* 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-12 01:01:34 +01:00
|
|
|
__gthread_objc_init_thread_system (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
c-typeck.c, [...]: Fix comment formatting.
* c-typeck.c, defaults.h, dwarf.h, dwarf2out.c, fold-const.c,
gthr-dce.h, gthr-posix.h, gthr-solaris.h, gthr-win32.h,
lambda-code.c, lambda-mat.c, libgcc2.c, stmt.c,
tree-ssa-pre.c, tree-vn.c, tree.h: Fix comment formatting.
From-SVN: r88102
2004-09-25 16:36:40 +02:00
|
|
|
/* Initialize the thread storage key. */
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
return __gthrw_(pthread_keycreate) (&_objc_thread_storage, NULL);
|
2000-07-20 09:27:26 +02:00
|
|
|
else
|
|
|
|
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-12 01:01:34 +01:00
|
|
|
__gthread_objc_close_thread_system (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
|
|
|
return 0;
|
|
|
|
else
|
|
|
|
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
|
2002-11-12 01:01:34 +01:00
|
|
|
__gthread_objc_thread_detach (void (*func)(void *), void *arg)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
objc_thread_t thread_id;
|
|
|
|
pthread_t new_thread_handle;
|
|
|
|
|
|
|
|
if (!__gthread_active_p ())
|
|
|
|
return NULL;
|
2002-06-04 13:30:46 +02:00
|
|
|
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
if (!(__gthrw_(pthread_create) (&new_thread_handle, pthread_attr_default,
|
2002-11-12 01:01:34 +01:00
|
|
|
(void *) func, arg)))
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
/* ??? May not work! (64bit) */
|
2002-11-12 01:01:34 +01:00
|
|
|
thread_id = *(objc_thread_t *) &new_thread_handle;
|
|
|
|
pthread_detach (&new_thread_handle); /* Fully detach thread. */
|
2000-07-20 09:27:26 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
thread_id = NULL;
|
2002-06-04 13:30:46 +02:00
|
|
|
|
2000-07-20 09:27:26 +02:00
|
|
|
return thread_id;
|
|
|
|
}
|
|
|
|
|
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
|
2002-11-12 01:01:34 +01:00
|
|
|
__gthread_objc_thread_set_priority (int priority)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
int sys_priority = 0;
|
|
|
|
|
|
|
|
if (!__gthread_active_p ())
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
switch (priority)
|
|
|
|
{
|
|
|
|
case OBJC_THREAD_INTERACTIVE_PRIORITY:
|
|
|
|
sys_priority = (PRI_FG_MIN_NP + PRI_FG_MAX_NP) / 2;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
case OBJC_THREAD_BACKGROUND_PRIORITY:
|
|
|
|
sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
|
|
|
|
break;
|
|
|
|
case OBJC_THREAD_LOW_PRIORITY:
|
|
|
|
sys_priority = (PRI_BG_MIN_NP + PRI_BG_MAX_NP) / 2;
|
|
|
|
break;
|
|
|
|
}
|
2002-06-04 13:30:46 +02:00
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Change the priority. */
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
if (pthread_setprio (__gthrw_(pthread_self) (), sys_priority) >= 0)
|
2000-07-20 09:27:26 +02:00
|
|
|
return 0;
|
|
|
|
else
|
|
|
|
/* Failed */
|
|
|
|
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-12 01:01:34 +01:00
|
|
|
__gthread_objc_thread_get_priority (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
int sys_priority;
|
|
|
|
|
|
|
|
if (__gthread_active_p ())
|
|
|
|
{
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
if ((sys_priority = pthread_getprio (__gthrw_(pthread_self) ())) >= 0)
|
2002-06-04 13:30:46 +02:00
|
|
|
{
|
2000-07-20 09:27:26 +02:00
|
|
|
if (sys_priority >= PRI_FG_MIN_NP
|
|
|
|
&& sys_priority <= PRI_FG_MAX_NP)
|
|
|
|
return OBJC_THREAD_INTERACTIVE_PRIORITY;
|
|
|
|
if (sys_priority >= PRI_BG_MIN_NP
|
|
|
|
&& sys_priority <= PRI_BG_MAX_NP)
|
|
|
|
return OBJC_THREAD_BACKGROUND_PRIORITY;
|
|
|
|
return OBJC_THREAD_LOW_PRIORITY;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Failed */
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
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-12 01:01:34 +01:00
|
|
|
__gthread_objc_thread_yield (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
__gthrw_(pthread_yield) ();
|
2000-07-20 09:27:26 +02:00
|
|
|
}
|
|
|
|
|
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-12 01:01:34 +01:00
|
|
|
__gthread_objc_thread_exit (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
|
|
|
/* exit the thread */
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
__gthrw_(pthread_exit) (&__objc_thread_exit_status);
|
2000-07-20 09:27:26 +02:00
|
|
|
|
|
|
|
/* Failed if we reached here */
|
|
|
|
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-12 01:01:34 +01:00
|
|
|
__gthread_objc_thread_id (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
|
|
|
{
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
pthread_t self = __gthrw_(pthread_self) ();
|
2000-07-20 09:27:26 +02:00
|
|
|
|
2005-11-09 21:57:30 +01:00
|
|
|
return (objc_thread_t) __gthrw_pthread_getunique_np (&self);
|
2000-07-20 09:27:26 +02:00
|
|
|
}
|
|
|
|
else
|
2002-11-12 01:01:34 +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-12 01:01:34 +01:00
|
|
|
__gthread_objc_thread_set_data (void *value)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
return __gthrw_(pthread_setspecific) (_objc_thread_storage, value);
|
2000-07-20 09:27:26 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
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-12 01:01:34 +01:00
|
|
|
__gthread_objc_thread_get_data (void)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
void *value = NULL;
|
|
|
|
|
|
|
|
if (__gthread_active_p ())
|
|
|
|
{
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
if (!(__gthrw_(pthread_getspecific) (_objc_thread_storage, &value)))
|
2000-07-20 09:27:26 +02:00
|
|
|
return value;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
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
|
2002-11-12 01:01:34 +01:00
|
|
|
__gthread_objc_mutex_allocate (objc_mutex_t mutex)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
2000-09-02 07:20:37 +02:00
|
|
|
if (__gthread_active_p ())
|
|
|
|
{
|
2002-11-12 01:01:34 +01:00
|
|
|
mutex->backend = objc_malloc (sizeof (pthread_mutex_t));
|
2000-09-02 07:20:37 +02:00
|
|
|
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
if (__gthrw_(pthread_mutex_init) ((pthread_mutex_t *) mutex->backend,
|
2002-11-12 01:01:34 +01:00
|
|
|
pthread_mutexattr_default))
|
2002-06-04 13:30:46 +02:00
|
|
|
{
|
2002-11-12 01:01:34 +01:00
|
|
|
objc_free (mutex->backend);
|
2002-06-04 13:30:46 +02:00
|
|
|
mutex->backend = NULL;
|
|
|
|
return -1;
|
|
|
|
}
|
2000-09-02 07:20:37 +02:00
|
|
|
}
|
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
|
2002-11-12 01:01:34 +01:00
|
|
|
__gthread_objc_mutex_deallocate (objc_mutex_t mutex)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
2000-09-06 08:55:34 +02:00
|
|
|
if (__gthread_active_p ())
|
|
|
|
{
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
if (__gthrw_(pthread_mutex_destroy) ((pthread_mutex_t *) mutex->backend))
|
2002-06-04 13:30:46 +02:00
|
|
|
return -1;
|
2000-09-06 08:55:34 +02:00
|
|
|
|
2002-11-12 01:01:34 +01:00
|
|
|
objc_free (mutex->backend);
|
2000-09-06 08:55:34 +02:00
|
|
|
mutex->backend = NULL;
|
|
|
|
}
|
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
|
2002-11-12 01:01:34 +01:00
|
|
|
__gthread_objc_mutex_lock (objc_mutex_t mutex)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
return __gthrw_(pthread_mutex_lock) ((pthread_mutex_t *) mutex->backend);
|
2000-07-20 09:27:26 +02:00
|
|
|
else
|
|
|
|
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
|
2002-11-12 01:01:34 +01:00
|
|
|
__gthread_objc_mutex_trylock (objc_mutex_t mutex)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ()
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
&& __gthrw_(pthread_mutex_trylock) ((pthread_mutex_t *) mutex->backend) != 1)
|
2000-07-20 09:27:26 +02:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Unlock the mutex */
|
|
|
|
static inline int
|
2002-11-12 01:01:34 +01:00
|
|
|
__gthread_objc_mutex_unlock (objc_mutex_t mutex)
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
return __gthrw_(pthread_mutex_unlock) ((pthread_mutex_t *) mutex->backend);
|
2000-07-20 09:27:26 +02:00
|
|
|
else
|
|
|
|
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
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
__gthread_objc_condition_allocate (objc_condition_t condition
|
|
|
|
__attribute__ ((__unused__)))
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
2000-08-04 19:25:19 +02:00
|
|
|
if (__gthread_active_p ())
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Unimplemented. */
|
2000-07-20 09:27:26 +02:00
|
|
|
return -1;
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Deallocate a condition. */
|
2000-07-20 09:27:26 +02:00
|
|
|
static inline int
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
__gthread_objc_condition_deallocate (objc_condition_t condition
|
|
|
|
__attribute__ ((__unused__)))
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Unimplemented. */
|
2000-07-20 09:27:26 +02:00
|
|
|
return -1;
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Wait on the condition */
|
|
|
|
static inline int
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
__gthread_objc_condition_wait (objc_condition_t condition
|
|
|
|
__attribute__ ((__unused__)),
|
|
|
|
objc_mutex_t mutex __attribute__ ((__unused__)))
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Unimplemented. */
|
2000-07-20 09:27:26 +02:00
|
|
|
return -1;
|
|
|
|
else
|
|
|
|
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
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
__gthread_objc_condition_broadcast (objc_condition_t condition
|
|
|
|
__attribute__ ((__unused__)))
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Unimplemented. */
|
2000-07-20 09:27:26 +02:00
|
|
|
return -1;
|
|
|
|
else
|
|
|
|
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
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +01:00
|
|
|
__gthread_objc_condition_signal (objc_condition_t condition
|
|
|
|
__attribute__ ((__unused__)))
|
2000-07-20 09:27:26 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
2001-10-12 15:10:33 +02:00
|
|
|
/* Unimplemented. */
|
2000-07-20 09:27:26 +02:00
|
|
|
return -1;
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else /* _LIBOBJC */
|
|
|
|
|
1997-12-25 00:56:08 +01:00
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_once (__gthread_once_t *__once, void (*__func) (void))
|
1997-12-25 00:56:08 +01:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
2009-02-16 13:19:34 +01:00
|
|
|
return __gthrw_(pthread_once) (__once, __func);
|
1997-12-25 00:56:08 +01:00
|
|
|
else
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
|
1997-12-25 00:56:08 +01:00
|
|
|
{
|
2009-02-16 13:19:34 +01:00
|
|
|
return __gthrw_(pthread_keycreate) (__key, __dtor);
|
1997-12-25 00:56:08 +01:00
|
|
|
}
|
|
|
|
|
2001-05-16 18:08:41 +02:00
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_key_delete (__gthread_key_t __key __attribute__ ((__unused__)))
|
2001-05-16 18:08:41 +02:00
|
|
|
{
|
|
|
|
/* Operation is not supported. */
|
|
|
|
return -1;
|
|
|
|
}
|
1997-12-25 00:56:08 +01:00
|
|
|
|
|
|
|
static inline void *
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_getspecific (__gthread_key_t __key)
|
1997-12-25 00:56:08 +01:00
|
|
|
{
|
2009-02-16 13:19:34 +01:00
|
|
|
void *__ptr;
|
|
|
|
if (__gthrw_(pthread_getspecific) (__key, &__ptr) == 0)
|
|
|
|
return __ptr;
|
1997-12-25 00:56:08 +01:00
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_setspecific (__gthread_key_t __key, const void *__ptr)
|
1997-12-25 00:56:08 +01:00
|
|
|
{
|
2009-08-02 03:38:27 +02:00
|
|
|
return __gthrw_(pthread_setspecific)
|
|
|
|
(__key, CONST_CAST2(void *, const void *, __ptr));
|
1997-12-25 00:56:08 +01:00
|
|
|
}
|
|
|
|
|
2001-08-04 00:13:22 +02:00
|
|
|
static inline void
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_mutex_init_function (__gthread_mutex_t *__mutex)
|
2001-08-04 00:13:22 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthrw_(pthread_mutex_init) (__mutex, pthread_mutexattr_default);
|
2001-08-04 00:13:22 +02:00
|
|
|
}
|
|
|
|
|
2008-03-01 11:46:31 +01:00
|
|
|
static inline int
|
2011-02-18 20:02:31 +01:00
|
|
|
__gthread_mutex_destroy (__gthread_mutex_t *__mutex)
|
2008-03-01 11:46:31 +01:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
2009-02-16 13:19:34 +01:00
|
|
|
return __gthrw_(pthread_mutex_destroy) (__mutex);
|
2008-03-01 11:46:31 +01:00
|
|
|
else
|
|
|
|
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)
|
1997-12-25 00:56:08 +01:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
2009-02-16 13:19:34 +01:00
|
|
|
return __gthrw_(pthread_mutex_lock) (__mutex);
|
1997-12-25 00:56:08 +01:00
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_mutex_trylock (__gthread_mutex_t *__mutex)
|
1997-12-25 00:56:08 +01:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
2009-02-16 13:19:34 +01:00
|
|
|
return __gthrw_(pthread_mutex_trylock) (__mutex);
|
1997-12-25 00:56:08 +01:00
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_mutex_unlock (__gthread_mutex_t *__mutex)
|
1997-12-25 00:56:08 +01:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
2009-02-16 13:19:34 +01:00
|
|
|
return __gthrw_(pthread_mutex_unlock) (__mutex);
|
1997-12-25 00:56:08 +01:00
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2004-08-28 04:33:54 +02:00
|
|
|
static inline int
|
2009-02-16 13:19:34 +01:00
|
|
|
__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *__mutex)
|
2004-08-28 04:33:54 +02:00
|
|
|
{
|
|
|
|
if (__gthread_active_p ())
|
|
|
|
{
|
2009-02-16 13:19:34 +01:00
|
|
|
pthread_mutexattr_t __attr;
|
|
|
|
int __r;
|
|
|
|
|
|
|
|
__r = __gthrw_(pthread_mutexattr_create) (&__attr);
|
|
|
|
if (!__r)
|
|
|
|
__r = __gthrw_(pthread_mutexattr_setkind_np) (&__attr,
|
|
|
|
MUTEX_RECURSIVE_NP);
|
|
|
|
if (!__r)
|
|
|
|
__r = __gthrw_(pthread_mutex_init) (__mutex, __attr);
|
|
|
|
if (!__r)
|
|
|
|
__r = __gthrw_(pthread_mutexattr_delete) (&__attr);
|
|
|
|
return __r;
|
2004-08-28 04:33:54 +02:00
|
|
|
}
|
re PR other/24829 (libobjc testsuite failures)
PR other/24829
PR target/24831
* gthr-dce.h: Do not gthrw-ify pthread_once_init,
pthread_key_delete. From John David Anglin. gthrw-ify
pthread_getunique_np only if it it's not a macro. Delete
UNUSED macro.
(__gthread_objc_condition_allocate, __gthread_objc_condition_deallocate,
__gthread_objc_condition_wait, __gthread_objc_condition_broadcast,
__gthread_objc_condition_signal, __gthread_key_delete): Add
"__attribute__ ((__unused__))" to unused arguments.
(__gthread_recursive_mutex_init_function): Add missing return.
* gthr-dce.h, gthr-tpf.h, gthr-solaris.h, gthr-posix.h,
gthr-posix95.h: Use macro-based approach for name redirection
on targets missing weakref.
From-SVN: r110278
2006-01-26 23:00:28 +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-11-30 20:47:11 +01:00
|
|
|
#endif
|
2001-05-26 03:31:47 +02:00
|
|
|
#endif /* ! GCC_GTHR_DCE_H */
|