Patch: Re: objc FAILs under hpux/-threads with gcc-2.96 CVS 20000816
Ovidiu Predescu
ovidiu@cup.hp.com
Fri Sep 1 22:22:00 GMT 2000
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;
> }
>
--
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.2 (GNU/Linux)
Comment: Exmh version 2.2 06/23/2000
iD8DBQE5sI5k1cM8Hy0YC5kRAu5RAJ9Xj8+qMBYtjj6CNNVYt0hzmCmuyACfc1rZ
VpfOHd+uUpamKcm0g4ALdeI=
=z0QG
-----END PGP SIGNATURE-----
More information about the Gcc-patches
mailing list