Changeset 31590 for main/trunk/greenstone3/src/java
- Timestamp:
- 2017-04-07T11:00:30+12:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/build/GS2PerlConstructor.java
r31578 r31590 658 658 // exceptions when reading from our perl process' stderr and stdout streams are handled by 659 659 // SynchronizedProcessLineByLineHandler.gotException() below. 660 public void gotException(Exception e) {660 public synchronized void gotException(Exception e) { 661 661 662 662 // do what original runPerlCommand() code always did when an exception occurred … … 688 688 } 689 689 690 public void gotLine(String line) {690 public synchronized void gotLine(String line) { 691 691 //if(this.source == STDERR) { 692 692 ///System.err.println("ERROR: " + line); … … 701 701 // "All methods on Logger are multi-thread safe", see 702 702 // http://stackoverflow.com/questions/14211629/java-util-logger-write-synchronization 703 704 try { 705 synchronized(bwHandle) { // get a lock on the writer handle, then write703 704 try { 705 bwHandle.write(line + "\n"); 706 706 707 bwHandle.write(line + "\n");708 }709 707 } catch(IOException ioe) { 710 708 String msg = (source == STDERR) ? "stderr" : "stdout"; … … 716 714 // and only immutable (final) vars are used. 717 715 sendProcessStatus(new ConstructionEvent(GS2PerlConstructor.this, GSStatus.CONTINUING, line)); 718 } 716 } 719 717 720 718 // This is called when we get an exception during the processing of a perl's 721 719 // input-, err- or output stream 722 public void gotException(Exception e) {720 public synchronized void gotException(Exception e) { 723 721 String msg = (source == STDERR) ? "stderr" : "stdout"; 724 722 msg = "Got exception when processing the perl process' " + msg + " stream.";
Note:
See TracChangeset
for help on using the changeset viewer.