This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: Re: objc FAILs under hpux/-threads with gcc-2.96 CVS 20000816
- To: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Subject: Re: Patch: Re: objc FAILs under hpux/-threads with gcc-2.96 CVS 20000816
- From: Ovidiu Predescu <ovidiu at cup dot hp dot com>
- Date: Fri, 01 Sep 2000 22:21:40 -0700
- Cc: gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
Thanks, I applied it!
Regards,
Ovidiu
--
Ovidiu Predescu <ovidiu@cup.hp.com>
http://orion.nsr.hp.com/ (inside HP's firewall only)
http://www.geocities.com/SiliconValley/Monitor/7464/
On Fri, 1 Sep 2000 16:29:22 -0400 (EDT), "John David Anglin"
<dave@hiauly1.hia.nrc.ca> wrote:
> > === objc Summary for unix/-threads ===
> >
> > # of expected passes 22
> > # of unexpected failures 22
>
> The enclosed patch corrects the problem. There are now no objc failures
> under hpux 10.20. The patch code is similar to that used for posix
> threads.
>
> The file libobjc/thr-dce.c contains a similar set of functions as gthr-dce.h.
> The code therein incorrectly passes `&(mutex->backend)'. I didn't fix
> thr-dce.c since it doesn't appear to be used anymore.
>
> Dave
> --
> J. David Anglin dave.anglin@nrc.ca
> National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
>
> 2000-08-31 J. David Anglin <dave@hiauly1.hia.nrc.ca>
>
> * gthr-dce.h (__gthread_objc_mutex_allocate): Create a pthread_mutex_t
> object before calling pthread_mutex_init.
>
> --- gthr-dce.h.orig Fri Aug 4 13:25:19 2000
> +++ gthr-dce.h Thu Aug 31 14:10:37 2000
> @@ -274,10 +274,18 @@
> static inline int
> __gthread_objc_mutex_allocate(objc_mutex_t mutex)
> {
> - if (__gthread_active_p ()
> - && pthread_mutex_init((pthread_mutex_t *)mutex->backend,
> + if (__gthread_active_p ())
> + {
> + mutex->backend = objc_malloc(sizeof(pthread_mutex_t));
> +
> + if (pthread_mutex_init((pthread_mutex_t *)mutex->backend,
> pthread_mutexattr_default))
> - return -1;
> + {
> + objc_free(mutex->backend);
> + mutex->backend = NULL;
> + return -1;
> + }
> + }
>
> return 0;
> }
>
PGP signature