changed some comments and indentation

This commit is contained in:
Fufu Fang 2021-08-31 00:13:17 +01:00
parent 7542db7077
commit 81ed433182
No known key found for this signature in database
GPG Key ID: 0F6BB5EF6F8BB729
1 changed files with 3 additions and 6 deletions

View File

@ -406,11 +406,11 @@ static long Data_read(Cache * cf, uint8_t * buf, off_t len, off_t offset)
} }
end: end:
lprintf(cache_lock_debug, lprintf(cache_lock_debug,
"Data_read(): thread %x: unlocking seek_lock;\n", "Data_read(): thread %x: unlocking seek_lock;\n",
pthread_self()); pthread_self());
PTHREAD_MUTEX_UNLOCK(&cf->seek_lock); PTHREAD_MUTEX_UNLOCK(&cf->seek_lock);
return byte_read; return byte_read;
} }
@ -469,7 +469,6 @@ static long Data_write(Cache * cf, const uint8_t * buf, off_t len, off_t offset)
"Data_write(): thread %x: unlocking seek_lock;\n", "Data_write(): thread %x: unlocking seek_lock;\n",
pthread_self()); pthread_self());
PTHREAD_MUTEX_UNLOCK(&cf->seek_lock); PTHREAD_MUTEX_UNLOCK(&cf->seek_lock);
return byte_written; return byte_written;
} }
@ -916,7 +915,6 @@ cf->content_length: %ld, Data_size(fn): %ld.\n", fn, cf->content_length, Data_si
"Cache_open(): thread %x: unlocking cf_lock;\n", "Cache_open(): thread %x: unlocking cf_lock;\n",
pthread_self()); pthread_self());
PTHREAD_MUTEX_UNLOCK(&cf_lock); PTHREAD_MUTEX_UNLOCK(&cf_lock);
return cf; return cf;
} }
@ -929,6 +927,7 @@ void Cache_close(Cache * cf)
cf->link->cache_opened--; cf->link->cache_opened--;
if (cf->link->cache_opened > 0) { if (cf->link->cache_opened > 0) {
lprintf(cache_lock_debug, lprintf(cache_lock_debug,
"Cache_close(): thread %x: unlocking cf_lock;\n", "Cache_close(): thread %x: unlocking cf_lock;\n",
pthread_self()); pthread_self());
@ -954,7 +953,6 @@ void Cache_close(Cache * cf)
"Cache_close(): thread %x: unlocking cf_lock;\n", "Cache_close(): thread %x: unlocking cf_lock;\n",
pthread_self()); pthread_self());
PTHREAD_MUTEX_UNLOCK(&cf_lock); PTHREAD_MUTEX_UNLOCK(&cf_lock);
return Cache_free(cf); return Cache_free(cf);
} }
@ -1112,8 +1110,7 @@ error.\n", recv, cf->blksz);
PTHREAD_MUTEX_UNLOCK(&cf->w_lock); PTHREAD_MUTEX_UNLOCK(&cf->w_lock);
/* /*
* -----------Download the next segment in background * ----------- Download the next segment in background -----------------
* -------------------
*/ */
bgdl: bgdl:
{ {