From ccea0d5d5d3b6f751baacf4bc9db6d9c712236ae Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 12 Sep 2003 20:40:14 +0000 Subject: [PATCH] seems printf isn't threadsafe --- tools/qflight/source/qflight.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/qflight/source/qflight.c b/tools/qflight/source/qflight.c index 401bccba3..cc4c08433 100644 --- a/tools/qflight/source/qflight.c +++ b/tools/qflight/source/qflight.c @@ -123,12 +123,14 @@ LightThread (void *l) while (1) { LOCK; i = bspfileface++; + if (i < bsp->numfaces) { + printf ("%5d / %d\r", i, bsp->numfaces); + fflush (stdout); + } UNLOCK; if (i >= bsp->numfaces) return 0; - printf ("%5d / %d\r", i, bsp->numfaces); - fflush (stdout); LightFace (l, i); } }