diff options
| author | Paul Buetow <paul@buetow.org> | 2010-11-21 16:20:55 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2010-11-21 16:20:55 +0000 |
| commit | 6fde6b0fe90abde84011202edd40fe46eb06af44 (patch) | |
| tree | ef760338c50b4df3ae9cca96347bca962fdbec7e /src/time/timo.cpp | |
| parent | 55b08bd93257d32df76efc4e8e3f49311c39ee82 (diff) | |
Diffstat (limited to 'src/time/timo.cpp')
| -rw-r--r-- | src/time/timo.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/time/timo.cpp b/src/time/timo.cpp index 276b517..0a923f1 100644 --- a/src/time/timo.cpp +++ b/src/time/timo.cpp @@ -1,12 +1,11 @@ /*:* *: File: ./src/time/timo.cpp *: - *: yChat; Homepage: ychat.buetow.org; Version 0.9.0-CURRENT + *: yChat; Homepage: www.yChat.org; Version 0.8.3-CURRENT *: *: Copyright (C) 2003 Paul C. Buetow, Volker Richter *: Copyright (C) 2004 Paul C. Buetow *: Copyright (C) 2005 EXA Digital Solutions GbR - *: Copyright (C) 2006, 2007 Paul C. Buetow *: *: This program is free software; you can redistribute it and/or *: modify it under the terms of the GNU General Public License @@ -31,17 +30,23 @@ using namespace std; timo::timo() -{} +{ + pthread_mutex_init( &mut_t_time, NULL ); +} timo::~timo() -{} +{ + pthread_mutex_destroy( &mut_t_time ); +} double timo::get_last_activity( ) { double d_ret; + pthread_mutex_lock ( &mut_t_time ); d_ret = wrap::TIMR->get_time_diff( t_time ); + pthread_mutex_unlock( &mut_t_time ); return d_ret; } @@ -49,7 +54,9 @@ timo::get_last_activity( ) void timo::renew_timeout( ) { + pthread_mutex_lock ( &mut_t_time ); time( &t_time ); + pthread_mutex_unlock( &mut_t_time ); } #endif |
