mailing list of musl libc
 help / color / mirror / code / Atom feed
2d7dce167223dbc2b37a5383aefa7ae36f8b257e blob 501 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
#include "stdio_impl.h"
#include "pthread_impl.h"

#ifdef __GNUC__
__attribute__((__noinline__))
#endif
static int locking_putc(int c, FILE *f)
{
	if (a_cas(&f->lock, 0, MAYBE_WAITERS-1)) __lockfile(f);
	c = putc_unlocked(c, f);
	if (a_swap(&f->lock, 0) & MAYBE_WAITERS)
		__wake(&f->lock, 1, 1);
	return c;
}

static inline int do_putc(int c, FILE *f)
{
	int l = f->lock;
	if (l < 0 || (l && (l & ~MAYBE_WAITERS) == __pthread_self()->tid))
		return putc_unlocked(c, f);
	return locking_putc(c, f);
}
debug log:

solving 2d7dce16 ...
found 2d7dce16 in https://inbox.vuxu.org/musl/20190722180740.16951-2-me@concati.me/ ||
	https://inbox.vuxu.org/musl/1636016.5PCnkOXM1K@prometheus.sedrubal.de/ ||
	https://inbox.vuxu.org/musl/1676444.u5bekTFY47@prometheus.sedrubal.de/
found 2014c4ec in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 2014c4ec4af9c68c283d5e8cb7b2a094eab436fa	src/stdio/putc.h

applying [1/3] https://inbox.vuxu.org/musl/20190722180740.16951-2-me@concati.me/
diff --git a/src/stdio/putc.h b/src/stdio/putc.h
index 2014c4ec..2d7dce16 100644

Checking patch src/stdio/putc.h...
Applied patch src/stdio/putc.h cleanly.

skipping https://inbox.vuxu.org/musl/1636016.5PCnkOXM1K@prometheus.sedrubal.de/ for 2d7dce16
skipping https://inbox.vuxu.org/musl/1676444.u5bekTFY47@prometheus.sedrubal.de/ for 2d7dce16
index at:
100644 2d7dce167223dbc2b37a5383aefa7ae36f8b257e	src/stdio/putc.h

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).