remove unused cond variable in logger

master
Andre Puschmann 7 years ago
parent 4deb251071
commit 87fd218c72

@ -67,7 +67,6 @@ private:
bool is_running; bool is_running;
std::string filename; std::string filename;
pthread_cond_t not_empty; pthread_cond_t not_empty;
pthread_cond_t not_full;
pthread_mutex_t mutex; pthread_mutex_t mutex;
pthread_t thread; pthread_t thread;
std::deque<str_ptr> buffer; std::deque<str_ptr> buffer;

@ -54,14 +54,12 @@ logger_file::~logger_file() {
} }
pthread_mutex_destroy(&mutex); pthread_mutex_destroy(&mutex);
pthread_cond_destroy(&not_empty); pthread_cond_destroy(&not_empty);
pthread_cond_destroy(&not_full);
} }
} }
void logger_file::init(std::string file, int max_length_) { void logger_file::init(std::string file, int max_length_) {
pthread_mutex_init(&mutex, NULL); pthread_mutex_init(&mutex, NULL);
pthread_cond_init(&not_empty, NULL); pthread_cond_init(&not_empty, NULL);
pthread_cond_init(&not_full, NULL);
max_length = (int64_t)max_length_*1024; max_length = (int64_t)max_length_*1024;
name_idx = 0; name_idx = 0;
filename = file; filename = file;
@ -92,7 +90,6 @@ void logger_file::run_thread() {
if(!is_running) return; // Thread done. Messages in buffer will be handled in flush. if(!is_running) return; // Thread done. Messages in buffer will be handled in flush.
} }
str_ptr s = buffer.front(); str_ptr s = buffer.front();
pthread_cond_signal(&not_full);
int n = 0; int n = 0;
if(logfile) if(logfile)
n = fprintf(logfile, "%s", s->c_str()); n = fprintf(logfile, "%s", s->c_str());

Loading…
Cancel
Save