Commit fb1bcd47 authored by Russ Cox's avatar Russ Cox

acid bug fix.

lock printf output to avoid interlacing debug prints.

R=r
DELTA=10  (7 added, 0 deleted, 3 changed)
OCL=35539
CL=35561
parent 7b5da358
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "runtime.h" #include "runtime.h"
static Lock debuglock;
void void
dump(byte *p, int32 n) dump(byte *p, int32 n)
...@@ -36,6 +37,8 @@ printf(int8 *s, ...) ...@@ -36,6 +37,8 @@ printf(int8 *s, ...)
int8 *p, *lp; int8 *p, *lp;
byte *arg, *narg; byte *arg, *narg;
lock(&debuglock);
lp = p = s; lp = p = s;
arg = (byte*)(&s+1); arg = (byte*)(&s+1);
for(; *p; p++) { for(; *p; p++) {
...@@ -96,6 +99,8 @@ printf(int8 *s, ...) ...@@ -96,6 +99,8 @@ printf(int8 *s, ...)
} }
if(p > lp) if(p > lp)
write(1, lp, p-lp); write(1, lp, p-lp);
unlock(&debuglock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment