timer initialization fix

This commit is contained in:
Arvid Norberg 2009-12-13 16:32:07 +00:00
parent c9a1bd219e
commit 25798ba1fa
2 changed files with 13 additions and 1 deletions

View File

@ -110,9 +110,16 @@ namespace libtorrent
struct tracker_logger;
#endif
// used to initialize the g_current_time before
// anything else
struct initialize_timer
{
initialize_timer();
};
// this is the link between the main thread and the
// thread started to run the main downloader loop
struct session_impl: boost::noncopyable
struct session_impl: boost::noncopyable, initialize_timer
{
// the size of each allocation that is chained in the send buffer

View File

@ -1592,6 +1592,11 @@ namespace aux {
// is not necessary
extern ptime g_current_time;
initialize_timer::initialize_timer()
{
g_current_time = time_now_hires();
}
void session_impl::on_tick(error_code const& e)
{
mutex::scoped_lock l(m_mutex);