提交 ab5e1e34 编写于 作者: R Rich Felker

fix build regression due to missing file for putc changes

commit d664061a inadvertently omitted
the new file putc.h.
上级 d8f2efa7
#include "stdio_impl.h"
#include "pthread_impl.h"
#ifdef __GNUC__
__attribute__((__noinline__))
#endif
static int locking_putc(int c, FILE *f, int tid)
{
if (a_cas(&f->lock, 0, tid)) __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 tid, l = f->lock;
if (l < 0 || (l & ~MAYBE_WAITERS) == (tid=__pthread_self()->tid))
return putc_unlocked(c, f);
return locking_putc(c, f, tid);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册