Removed old thread test code.

This commit is contained in:
rakshasa
2012-02-16 15:08:30 +09:00
parent 4bcf7f4f5e
commit 1b4d8f9626
4 changed files with 2 additions and 31 deletions
-9
View File
@@ -306,17 +306,8 @@ d_multicall(const torrent::Object::list_type& args) {
return resultRaw;
}
torrent::Object
test_thread_locking() {
worker_thread->queue_item(&ThreadWorker::start_log_counter);
return torrent::Object();
}
void
initialize_command_events() {
CMD2_ANY("test.thread_locking", std::bind(&test_thread_locking));
CMD2_ANY_STRING ("on_ratio", std::bind(&apply_on_ratio, std::placeholders::_2));
CMD2_ANY ("start_tied", std::bind(&apply_start_tied));
+2 -2
View File
@@ -185,7 +185,7 @@ SCgiTask::event_read() {
result = write(m_parent->log_fd(), "\n---\n", sizeof("\n---\n"));
}
lt_log_print(torrent::LOG_RPC_DEBUG, "---\n%*s\n---", m_bufferSize - std::distance(m_buffer, m_body), m_body);
lt_log_print_dump(torrent::LOG_RPC_DEBUG, m_body, m_bufferSize - std::distance(m_buffer, m_body), "SCGI RPC read.", 0);
// Close if the call failed, else stay open to write back data.
if (!m_parent->receive_call(this, m_body, m_bufferSize - std::distance(m_buffer, m_body)))
@@ -246,7 +246,7 @@ SCgiTask::receive_write(const char* buffer, uint32_t length) {
result = write(m_parent->log_fd(), "\n---\n", sizeof("\n---\n"));
}
lt_log_print(torrent::LOG_RPC_DEBUG, "---\n%*s\n---", m_bufferSize, m_buffer);
lt_log_print_dump(torrent::LOG_RPC_DEBUG, m_buffer, m_bufferSize, "SCGI RPC write.", 0);
event_write();
return true;
-18
View File
@@ -52,7 +52,6 @@
#include "rpc/parse_commands.h"
ThreadWorker::ThreadWorker() {
m_taskTouchLog.slot() = std::tr1::bind(&ThreadWorker::task_touch_log, this);
}
ThreadWorker::~ThreadWorker() {
@@ -100,14 +99,6 @@ ThreadWorker::start_scgi(ThreadBase* baseThread) {
thread->m_safe.scgi->activate();
}
void
ThreadWorker::start_log_counter(ThreadBase* baseThread) {
ThreadWorker* thread = (ThreadWorker*)baseThread;
if (!thread->m_taskTouchLog.is_queued())
priority_queue_insert(&thread->m_taskScheduler, &thread->m_taskTouchLog, cachedTime);
}
void
ThreadWorker::msg_change_xmlrpc_log(ThreadBase* baseThread) {
ThreadWorker* thread = (ThreadWorker*)baseThread;
@@ -139,12 +130,3 @@ ThreadWorker::change_xmlrpc_log() {
control->core()->push_log_std("Logging XMLRPC events to '" + m_xmlrpcLog + "'.");
}
void
ThreadWorker::task_touch_log() {
priority_queue_insert(&m_taskScheduler, &m_taskTouchLog, cachedTime + rak::timer::from_seconds(1));
acquire_global_lock();
control->core()->push_log("Tick Tock.");
release_global_lock();
}
-2
View File
@@ -63,7 +63,6 @@ public:
void set_xmlrpc_log(const std::string& filename);
static void start_scgi(ThreadBase* thread);
static void start_log_counter(ThreadBase* thread);
static void msg_change_xmlrpc_log(ThreadBase* thread);
private:
@@ -77,7 +76,6 @@ private:
rpc::SCgi* scgi;
};
rak::priority_item m_taskTouchLog;
safe_type m_safe;
// The following types shall only be modified while holding the