Formatted code to align tabs

This commit is contained in:
Zachary Moore 2017-02-16 18:18:00 -05:00 committed by GitHub
parent 434a8856c6
commit 2be98d540e

View File

@ -243,7 +243,8 @@ void
locktestthread2(void *junk, unsigned long num) locktestthread2(void *junk, unsigned long num)
{ {
(void)junk; (void)junk;
//first thread acquire lock
//first thread acquire lock
if(num == 0){ if(num == 0){
lock_acquire(testlock); lock_acquire(testlock);
} }
@ -252,8 +253,8 @@ locktestthread2(void *junk, unsigned long num)
if(lock_do_i_hold(testlock)){ if(lock_do_i_hold(testlock)){
goto fail; goto fail;
} }
//make sure release panics based on thread matching //make sure release panics based on thread matching
lock_release(testlock); lock_release(testlock);
} }
V(donesem); V(donesem);
@ -373,7 +374,7 @@ locktest4(int nargs, char **args) {
(void) args; (void) args;
kprintf_n("Starting lt4...\n"); kprintf_n("Starting lt4...\n");
kprintf_n("(This test panics on success!)\n"); kprintf_n("(This test panics on success!)\n");
testlock = lock_create("testlock"); testlock = lock_create("testlock");
if(testlock == NULL) { if(testlock == NULL) {
@ -386,7 +387,7 @@ locktest4(int nargs, char **args) {
panic("lt4: sem_create failed\n"); panic("lt4: sem_create failed\n");
} }
//Only 2 threads for simplification //Only 2 threads for simplification
int i, result; int i, result;
for (i=0; i<2; i++) { for (i=0; i<2; i++) {
kprintf_t("."); kprintf_t(".");
@ -402,14 +403,15 @@ locktest4(int nargs, char **args) {
} }
//no lock destroy in case a panic is triggered //no lock destroy in case a panic is triggered, memory leak necessary
sem_destroy(donesem); sem_destroy(donesem);
testlock = NULL; testlock = NULL;
donesem = NULL; donesem = NULL;
secprintf(SECRET, "Should panic...", "lt4"); secprintf(SECRET, "Should panic...", "lt4");
/* Should not get here on success. */ /* Should not get here on success. */
kprintf_t("\n"); kprintf_t("\n");
success(TEST161_FAIL, SECRET, "lt4"); success(TEST161_FAIL, SECRET, "lt4");