public void sync() {boolean interrupted = false;try {while (true) {MergeThread toSync = null;synchronized (this) {for (MergeThread t : mergeThreads) {if (t.isAlive() && t != Thread.currentThread()) {toSync = t;break;}}}if (toSync != null) {try {toSync.join();} catch (InterruptedException ie) {interrupted = true;}} else {break;}}} finally {if (interrupted) Thread.currentThread().interrupt();}}

public void sync ( ) { boolean interrupted = false ; try { while ( true ) { MergeThread toSync = null ; synchronized ( this ) { for ( MergeThread t : mergeThreads ) { if ( t . isAlive ( ) && t != Thread . currentThread ( ) ) { toSync = t ; break ; } } } if ( toSync != null ) { try { toSync . join ( ) ; } catch ( InterruptedException ie ) { interrupted = true ; } } else { break ; } } } finally { if ( interrupted ) Thread . currentThread ( ) . interrupt ( ) ; } }
public virtual void Sync(){bool interrupted = false;try{while (true){MergeThread toSync = null;lock (this){foreach (MergeThread t in m_mergeThreads){if (t != null && t.IsAlive){toSync = t;break;}}}if (toSync != null){try{toSync.Join();}catch (ThreadInterruptedException ie){interrupted = true;}}else{break;}}}finally{if (interrupted){Thread.CurrentThread.Interrupt();}}}
