aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2009-04-22 10:53:53 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2009-04-22 10:53:53 +0000
commit24a40b356f07a2a4d50d4c36e5bbb86ef06d3925 (patch)
treee11dcde40e7283e50e32e96ee6676f534174b607 /gcc/config
parentaa9037807b6e7a681a4229ab2c34539323d3f8b3 (diff)
downloadgcc-24a40b356f07a2a4d50d4c36e5bbb86ef06d3925.zip
gcc-24a40b356f07a2a4d50d4c36e5bbb86ef06d3925.tar.gz
gcc-24a40b356f07a2a4d50d4c36e5bbb86ef06d3925.tar.bz2
gthr-vxworks.h (struct __gthread_once_t): Add alignment and padding for PPC.
* gthr-vxworks.h (struct __gthread_once_t): Add alignment and padding for PPC. (__GTHREAD_ONCE_INIT): Adjust ppc initializer. * config/vxlib.c (__gthread_once): Add race guard for PPC. From-SVN: r146566
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/vxlib.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/config/vxlib.c b/gcc/config/vxlib.c
index 686d66d..0ff996c 100644
--- a/gcc/config/vxlib.c
+++ b/gcc/config/vxlib.c
@@ -65,7 +65,15 @@ __gthread_once (__gthread_once_t *guard, void (*func)(void))
__gthread_lock_library ();
#else
while (!vxTas ((void *)&guard->busy))
- taskDelay (1);
+ {
+#ifdef __PPC__
+ /* This can happen on powerpc, which is using all 32 bits
+ of the gthread_once_t structure. */
+ if (guard->done)
+ return;
+#endif
+ taskDelay (1);
+ }
#endif
/* Only one thread at a time gets here. Check ->done again, then