Changed spaces to tabs on synch.c

This commit is contained in:
Zachary Moore 2017-02-16 12:19:53 -05:00 committed by GitHub
parent b51f2a88de
commit 8eb6dc55df

View File

@ -242,24 +242,24 @@ static
void void
locktestthread2(void *junk, unsigned long num) locktestthread2(void *junk, unsigned long num)
{ {
(void)junk; (void)junk;
if(num == 0){ if(num == 0){
lock_acquire(testlock); lock_acquire(testlock);
} }
else{ else{
if(lock_do_i_hold(testlock)){ if(lock_do_i_hold(testlock)){
goto fail; goto fail;
} }
} }
V(donesem); V(donesem);
return; return;
fail: fail:
failif(true); failif(true);
V(donesem); V(donesem);
return; return;
} }
int int
@ -366,47 +366,47 @@ locktest3(int nargs, char **args) {
int int
locktest4(int nargs, char **args) { locktest4(int nargs, char **args) {
(void) nargs; (void) nargs;
(void) args; (void) args;
kprintf_n("Starting lt4...\n"); kprintf_n("Starting lt4...\n");
test_status = TEST161_SUCCESS; test_status = TEST161_SUCCESS;
testlock = lock_create("testlock"); testlock = lock_create("testlock");
if(testlock == NULL) { if(testlock == NULL) {
panic("lt4: lock_create failed\n"); panic("lt4: lock_create failed\n");
} }
donesem = sem_create("donesem", 0); donesem = sem_create("donesem", 0);
if (donesem == NULL) { if (donesem == NULL) {
lock_destroy(testlock); lock_destroy(testlock);
panic("lt1: sem_create failed\n"); panic("lt4: sem_create failed\n");
} }
int i, result; int i, result;
for (i=0; i<2; i++) { for (i=0; i<2; i++) {
kprintf_t("."); kprintf_t(".");
result = thread_fork("lt4", NULL, locktestthread2, NULL, i); result = thread_fork("lt4", NULL, locktestthread2, NULL, i);
if (result) { if (result) {
panic("lt1: thread_fork failed: %s\n", strerror(result)); panic("lt4: thread_fork failed: %s\n", strerror(result));
} }
} }
for(i=0; i<2; i++) { for(i=0; i<2; i++) {
kprintf_t("."); kprintf_t(".");
P(donesem); P(donesem);
} }
lock_destroy(testlock); lock_destroy(testlock);
sem_destroy(donesem); sem_destroy(donesem);
testlock = NULL; testlock = NULL;
donesem = NULL; donesem = NULL;
kprintf_t("\n"); kprintf_t("\n");
success(test_status, SECRET, "lt1"); success(test_status, SECRET, "lt1");
return 0; return 0;
} }
static static