Changeset - 9b97425c18ce
[Not reviewed]
0 1 0
HanzZ - 14 years ago 2011-10-11 00:34:38
hanzz.k@gmail.com
Debug for event loop
1 file changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/spectrumeventloop.cpp
Show inline comments
 
@@ -27,6 +27,11 @@
 
#include <event.h>
 
#endif
 

	
 
#include "log4cxx/logger.h"
 

	
 
using namespace log4cxx;
 

	
 
static LoggerPtr logger = Logger::getLogger("SpectrumEventLoop");
 

	
 
using namespace Swift;
 

	
 
@@ -35,6 +40,7 @@ static SpectrumEventLoop *loop;
 
// Fires the event's callback and frees the event
 
static gboolean processEvent(void *data) {
 
	Event *ev = (Event *) data;
 
	LOG4CXX_INFO(logger, "got event in main thread " << ev);
 
	loop->handle(ev);
 
	return FALSE;
 
}
 
@@ -93,5 +99,6 @@ void SpectrumEventLoop::stop() {
 
void SpectrumEventLoop::post(const Event& event) {
 
	// pass copy of event to main thread
 
	Event *ev = new Event(event);
 
	LOG4CXX_INFO(logger, "posting event to main thread " << ev);
 
	purple_timeout_add(0, processEvent, ev);
 
}
0 comments (0 inline, 0 general)