[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10891: Use indexes for thread ids,
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10891: Use indexes for thread ids, for terseness of log lines |
Date: |
Wed, 20 May 2009 10:37:23 +0200 |
User-agent: |
Bazaar (1.13.1) |
------------------------------------------------------------
revno: 10891
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Wed 2009-05-20 10:37:23 +0200
message:
Use indexes for thread ids, for terseness of log lines
modified:
libbase/log.cpp
=== modified file 'libbase/log.cpp'
--- a/libbase/log.cpp 2009-04-08 11:48:21 +0000
+++ b/libbase/log.cpp 2009-05-20 08:37:23 +0000
@@ -25,6 +25,7 @@
#include <cctype> // for std::isprint
#include <cstring> // std::memset
+#include <map>
#include <sstream>
#include <fstream>
#include <iomanip> // for std::setfill
@@ -90,7 +91,16 @@
std::time(&t);
std::strftime(buf, sizeof(buf), fmt, std::localtime(&t));
- o << getpid() << ":" << get_thread_id() << "] " << buf;
+ static std::map<int, int> threadMap;
+ int tid = get_thread_id();
+ int& htid = threadMap[tid];
+ if ( ! htid )
+ {
+ htid = threadMap.size();
+ // TODO: notify actual thread id for index
+ }
+
+ o << getpid() << ":" << htid << "] " << buf;
return o;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10891: Use indexes for thread ids, for terseness of log lines,
Sandro Santilli <=