# Fixing 1
// DFixer command {{{
D deadlock.cpp 68:2 	/* DFixer: original hLock*/
D deadlock.cpp 72:2 	/* DFixer: original wLock*/
A deadlock.cpp 68:2 	/* DFixer added:*/ /* DFixer preAcquisitoin */ preAcq_pthread_mutex_lock(& lock2, & lock1);
// }}}


# Fixing 2
// DFixer command {{{
D deadlock.cpp 43:2 	/* DFixer: original hLock*/
D deadlock.cpp 22:2 	/* DFixer: original wLock*/
A deadlock.cpp 43:2 	/* DFixer added:*/ /* DFixer preAcquisitoin */ preAcq_pthread_mutex_lock(& lock1, & lock2); /* DFixer multiple entries (set) */ setPreAcqTaken ( & lock2 );
A deadlock.cpp 22:2 	/* DFixer added:*/ /* DFixer multiple entries (clear)*/  if( ! preAcqTaken( & lock2 )) { pthread_mutex_lock( &lock2); } 
A deadlock.cpp 24:2 	/* DFixer added:*/ /* DFixer multiple entries (clear) */  clearPreAcq( & lock2);  
A deadlock.cpp 62:2 	/* DFixer added:*/ /* DFixer multiple exits */ if( ! preAcqTaken( & lock2 )) {pthread_mutex_unlock ( & lock2 ); /* DFixer multiple entries (clear again) */  clearPreAcq( & lock2); } 
P deadlock.cpp 58:3 	/* DFixer appended:*/ /* DFixer: loop */ if ( preAcqTaken( & lock2) ) { pthread_mutex_unlock ( & lock2 ); /* DFixer multiple entries (clear again) */  clearPreAcq( & lock2); } 
D deadlock.cpp 24:2 	/* DFixer: original rel(wLock) in loop*/
A deadlock.cpp 24:2 	/* DFixer added:*/ /* DFixer: loop */ if ( !preAcqTaken( & lock2) ) { pthread_mutex_unlock ( & lock2); }
D ./deadlock.cpp 45:2 	/* DFixer:  original third lock.*/
A ./deadlock.cpp 45:2 	/* DFixer added:*/ /* DFixer: handle other lock acquisitions */ setHWCondOn( &lock1, &lock2); pthread_mutex_unlock( &lock2); preAcq_pthread_mutex_lock( &lock3, &lock2); setHWCondOff( &lock1, &lock2);
D ./deadlock.cpp 68:2 	/* DFixer:  original acq(h) of a second thread. */
A ./deadlock.cpp 68:2 	/* DFixer added:*/ /* DFixer: handle other lock acquisitions (the second thread) */  while(pthread_mutex_trylock(&lock2)){ if( getHWCond( &lock2, &lock1)) pthread_mutex_unlock(&lock2); else break; } 
D ./deadlock.cpp 46:2 	/* DFixer:  original third lock.*/
A ./deadlock.cpp 46:2 	/* DFixer added:*/ /* DFixer: handle wait(k) */ setHWCondOn( &lock1, &lock2); pthread_mutex_unlock(&lock2); pthread_cond_wait(&cond, &lock3); pthread_mutex_unlock( &lock3); preAcq_pthread_mutex_lock( &lock3, &lock2); setHWCondOff( &lock1, &lock2);
// }}}


