libgcj/1480: pthread_mutex_init in libjava/posix-threads.cc
joerg.brunsmann@fernuni-hagen.de
joerg.brunsmann@fernuni-hagen.de
Wed Dec 20 12:29:00 GMT 2000
>Number: 1480
>Category: libgcj
>Synopsis: pthread_mutex_init in libjava/posix-threads.cc
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: tromey
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 20 12:20:38 PST 2000
>Closed-Date: Tue Nov 30 10:53:14 PST 1999
>Last-Modified: Tue Nov 30 11:00:01 PST 1999
>Originator: joerg.brunsmann@fernuni-hagen.de
>Release: libgcj-snapshot-1999-11-09
>Organization:
>Environment:
sparc/Solaris 2.7
>Description:
/usr/include/pthread.h on solaris shows:
int pthread_mutex_init(pthread_mutex_t *mutex,
const pthread_mutexattr_t *attr);
In posix-threads you say in function
_Jv_MutexInit (_Jv_Mutex_t *mu)
line 168:
pthread_mutex_init (mu, val);
which yields this error:
/home/joerg/egcs.compile/libgcj/libjava/posix-threads.cc: In function `void _Jv_MutexInit (_Jv_Mutex_t *)':
/home/joerg/egcs.compile/libgcj/libjava/posix-threads.cc:168: cannot convert `_Jv_Mutex_t *' to `pthread_mutex_t *' for argument `1' to `pthread_mutex_init (pthread_mutex_t *, const pthread_mutexattr_t *)'
>How-To-Repeat:
configure with
--enable-threads=posix --enable-java-gc=boehm
>Fix:
>Release-Note:
>Audit-Trail:
Formerly PR libgcj/98
From: Tom Tromey <tromey@cygnus.com>
To: Java Gnats Server <java-gnats@sourceware.cygnus.com>
Cc: joerg.brunsmann@fernuni-hagen.de
Subject: libgcj/98
Date: 12 Nov 1999 09:52:46 -0700
I'm resending this since it didn't make it the last time.
Try the appended patch. If it works for you I'll check it in.
Tom
Index: posix-threads.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/posix-threads.cc,v
retrieving revision 1.13
diff -u -r1.13 posix-threads.cc
--- posix-threads.cc 1999/11/04 16:45:11 1.13
+++ posix-threads.cc 1999/11/11 17:19:10
@@ -165,7 +165,10 @@
val = &attr;
#endif
- pthread_mutex_init (mu, val);
+ pthread_mutex_init (_Jv_PthreadGetMutex (mu), val);
+#ifdef PTHREAD_MUTEX_IS_STRUCT
+ mu->count = 0;
+#endif
#if defined (HAVE_PTHREAD_MUTEXATTR_SETTYPE) || defined (HAVE_PTHREAD_MUTEXATTR_SETKIND_NP)
pthread_mutexattr_destroy (&attr);
State-Changed-From-To: open->closed
State-Changed-By: tromey
State-Changed-When: Tue Nov 30 10:53:14 1999
State-Changed-Why:
I've checked in the fix. Reporter says it worked.
From: tromey@cygnus.com
To: java-gnats@sourceware.cygnus.com, joerg.brunsmann@fernuni-hagen.de,
tromey@cygnus.com
Cc:
Subject: Re: libgcj/98
Date: 30 Nov 1999 18:53:14 -0000
Synopsis: pthread_mutex_init in libjava/posix-threads.cc
State-Changed-From-To: open->closed
State-Changed-By: tromey
State-Changed-When: Tue Nov 30 10:53:14 1999
State-Changed-Why:
I've checked in the fix. Reporter says it worked.
http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=98&database=java
From: tromey@sourceware.cygnus.com
To: java-gnats@sourceware.cygnus.com
Cc:
Subject: libgcj/98
Date: 30 Nov 1999 18:53:15 -0000
* posix-threads.cc (_Jv_MutexInit): Use _Jv_PthreadGetMutex to get
mutex to initialize. Initialize `count' if required.
Fixes PR libgcj/98.
>Unformatted:
More information about the Gcc-prs
mailing list