diff mbox series

Committed: io/async.h: Use __gthread_mutex_t, not pthread_mutex_t.

Message ID 201809051034.w85AYtjI018659@ignucius.se.axis.com
State New
Headers show
Series Committed: io/async.h: Use __gthread_mutex_t, not pthread_mutex_t. | expand

Commit Message

Hans-Peter Nilsson Sept. 5, 2018, 10:34 a.m. UTC
These pthread_mutex_t were obviously meant to be
__gthread_mutex_t.  See other declarations.  Not being that,
broke cris-elf build at r264070, restored with this patch.  Also
regtested on native x86_64-pc-linux-gnu.

I'm not sure know why no other bare-iron target saw this, but
perhaps it's because my newlib is a bit dated (...looks... yes,
looks like newlib has grown pthreads since then, but that
doesn't excuse this flaw).  Still, there may be other similar
flaws behind #ifdefs, this is just a build-fixing patch.

Committed as obvious.

libgfortran:
	* io/async.h: Use __gthread_mutex_t, not pthread_mutex_t.


brgds, H-P

Comments

Bernhard Reutner-Fischer Sept. 5, 2018, 10:40 a.m. UTC | #1
On Wed, 5 Sep 2018 at 12:35, Hans-Peter Nilsson
<hans-peter.nilsson@axis.com> wrote:
>
> These pthread_mutex_t were obviously meant to be
> __gthread_mutex_t.  See other declarations.  Not being that,
> broke cris-elf build at r264070, restored with this patch.  Also
> regtested on native x86_64-pc-linux-gnu.
>
> I'm not sure know why no other bare-iron target saw this, but
> perhaps it's because my newlib is a bit dated (...looks... yes,
> looks like newlib has grown pthreads since then, but that
> doesn't excuse this flaw).  Still, there may be other similar
> flaws behind #ifdefs, this is just a build-fixing patch.

Thanks for the fix!
I mentioned the need to fix this in
https://gcc.gnu.org/ml/fortran/2018-09/msg00006.html
and i hope Thomas and Nicolas will take care of the rest of the
comments soonish.

cheers,
diff mbox series

Patch

Index: libgfortran/io/async.h
===================================================================
--- libgfortran/io/async.h	(revision 264070)
+++ libgfortran/io/async.h	(working copy)
@@ -337,8 +337,8 @@  struct adv_cond
 
 typedef struct async_unit
 {
-  pthread_mutex_t io_lock;   /* Lock for doing actual I/O. */
-  pthread_mutex_t lock;      /* Lock for manipulating the queue structure.  */
+  __gthread_mutex_t io_lock;   /* Lock for doing actual I/O. */
+  __gthread_mutex_t lock;      /* Lock for manipulating the queue structure.  */
   bool empty;
   struct
   {