}
static void log_entries_clean(void *p) {
+ printf("log_entries_clean\n");
free(helper.p);
}
}
static void log_flush(void *p) {
+ printf("log_flush\n");
pthread_mutex_lock(&logging_mutex);
+ printf("log_flush2\n");
if(helper.start!=NULL) {
fputs(LOG_MESSAGE_FLUSH,stderr);
}
+ printf("log_flush3\n");
while(helper.start!=NULL) {
log_print(helper.start);
}
+ printf("log_flush4\n");
helper.start = NULL;
helper.end = NULL;
helper.next = 0;
pthread_mutex_unlock(&logging_mutex);
+ printf("log_flush5\n");
}
void log_print() {
pthread_testcancel();
pthread_mutex_lock(&logging_mutex);
+ printf("logging mutex lock\n");
log_print();
pthread_mutex_unlock(&logging_mutex);
+ printf("logging mutex unlock\n");
}
pthread_cleanup_pop(1);
int ret_cancel, ret_join;
void *res;
- log_info("shutting down logging thread\n");
+ printf("shutting down logging thread\n");
ret_cancel = pthread_cancel(logging_thread);
ret_join = pthread_join(logging_thread,&res);
- log_info("shutting down logging thread 2\n");
-
logging_thread = pthread_self();
+ printf("shutting down logging thread 2\n");
+
if((ret_cancel!=0)||(ret_join!=0)||(res!=PTHREAD_CANCELED)) {
log_err(LOG_MESSAGE_SHUTDOWN_FAILED);
} else {
static void session_clean() {
struct torrent *p;
- log_info("clearing session\n");
+ printf("clearing session\n");
for(size_t i=0;i<session.torrents.paths->size;i++) {
p = session.torrents.paths->map[i];
hashmap_clear(session.torrents.paths);
hashmap_free(session.torrents.paths);
- log_info("session cleared\n");
+ printf("session cleared\n");
}
struct torrent *session_find_torrent(uint8_t *infohash, size_t size) {
return -1;
}
- log_info("session setup\n");
+ printf("session setup\n");
return 1;
}
}
static void watch_shutdown() {
- log_info("watch thread stopping\n");
+ printf("watch thread stopping\n");
if(0!=pthread_cancel(watching_thread)) {
log_err(WATCH_MESSAGE_SHUTDOWN_FAILED);
}
close(watch_fd);
- log_info("watch thread stopped\n");
+ printf("watch thread stopped\n");
}