1
1
import haxe .crypto .Md5 ;
2
2
import haxe .io .Path ;
3
3
import sys .FileSystem ;
4
+ #if haxe4
5
+ import sys .thread .Mutex ;
6
+ #elseif cpp
7
+ import cpp .vm .Mutex ;
8
+ #else
9
+ import neko .vm .Mutex ;
10
+ #end
11
+
4
12
using StringTools ;
5
13
6
14
private class FlagInfo
@@ -301,6 +309,8 @@ class Compiler
301
309
catch (e : Dynamic ) { }
302
310
}
303
311
312
+ static public var printMutex = new Mutex ();
313
+
304
314
public function compile (inFile : File ,inTid : Int ,headerFunc : Void -> Void ,pchTimeStamp : Null <Float >,inProgess : Null <Progress >)
305
315
{
306
316
var obj_name = getObjName (inFile );
@@ -382,34 +392,41 @@ class Compiler
382
392
if (delayedFilename != null )
383
393
args .push (delayedFilename );
384
394
385
- var tagInfo = inFile .mTags == null ? " " : " " + inFile .mTags .split (" ," );
386
-
387
- var fileName = inFile .mName ;
388
- var split = fileName .split (" /" );
389
- if (split .length > 1 )
395
+ if (! Log .verbose )
390
396
{
391
- fileName = " \x1b [2m-\x1b [0m \x1b [33m" + split .slice (0 , split .length - 1 ).join (" /" ) + " /\x1b [33;1m" + split [split .length - 1 ] + " \x1b [0m" ;
392
- }
393
- else
394
- {
395
- fileName = " \x1b [2m-\x1b [0m \x1b [33;1m" + fileName + " \x1b [0m" ;
396
- }
397
- fileName + = " \x1b [3m" + tagInfo + " \x1b [0m" ;
397
+ var tagInfo = inFile .mTags == null ? " " : " " + inFile .mTags .split (" ," );
398
398
399
- if (inProgess != null )
400
- {
401
- inProgess .progress (1 );
402
- fileName = inProgess .getProgress () + fileName ;
399
+ var fileName = inFile .mName ;
400
+ var split = fileName .split (" /" );
401
+ if (split .length > 1 )
402
+ {
403
+ fileName = " \x1b [2m-\x1b [0m \x1b [33m" + split .slice (0 , split .length - 1 ).join (" /" ) + " /\x1b [33;1m" + split [split .length - 1 ] + " \x1b [0m" ;
404
+ }
405
+ else
406
+ {
407
+ fileName = " \x1b [2m-\x1b [0m \x1b [33;1m" + fileName + " \x1b [0m" ;
408
+ }
409
+ fileName + = " \x1b [3m" + tagInfo + " \x1b [0m" ;
410
+
411
+ printMutex .acquire ();
412
+
413
+ if (inProgess != null )
414
+ {
415
+ inProgess .progress (1 );
416
+ fileName = inProgess .getProgress () + fileName ;
417
+ }
418
+
419
+ if ((inTid >= 0 && BuildTool .threadExitCode == 0 ) || inTid < 0 )
420
+ {
421
+ Log .info (fileName );
422
+ }
423
+ printMutex .release ();
403
424
}
404
425
405
426
if (inTid >= 0 )
406
427
{
407
428
if (BuildTool .threadExitCode == 0 )
408
429
{
409
- if (! Log .verbose )
410
- {
411
- Log .info (fileName );
412
- }
413
430
var err = ProcessManager .runProcessThreaded (exe , args , null );
414
431
cleanTmp (tmpFile );
415
432
if (err != 0 )
@@ -422,10 +439,6 @@ class Compiler
422
439
}
423
440
else
424
441
{
425
- if (! Log .verbose )
426
- {
427
- Log .info (fileName );
428
- }
429
442
var result = ProcessManager .runProcessThreaded (exe , args , null );
430
443
cleanTmp (tmpFile );
431
444
if (result != 0 )
0 commit comments