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/timr.h | |
| parent | 55b08bd93257d32df76efc4e8e3f49311c39ee82 (diff) | |
Diffstat (limited to 'src/time/timr.h')
| -rw-r--r-- | src/time/timr.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/time/timr.h b/src/time/timr.h index 69d411c..0460cba 100644 --- a/src/time/timr.h +++ b/src/time/timr.h @@ -1,12 +1,11 @@ /*:* *: File: ./src/time/timr.h *: - *: 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 @@ -28,11 +27,13 @@ #ifndef TIMR_H #define TIMR_H +#include "../thrd/thro.h" + #include <unistd.h> using namespace std; -class timr +class timr : public thro { private: bool b_timer_active; @@ -40,6 +41,9 @@ private: string s_uptime; string s_time; + pthread_mutex_t mut_s_time; + pthread_mutex_t mut_s_uptime; + pthread_mutex_t mut_i_offset; public: timr(); @@ -56,7 +60,9 @@ public: get_time( ) { string s_ret; + pthread_mutex_lock ( &mut_s_time ); s_ret = this->s_time; + pthread_mutex_unlock( &mut_s_time ); return s_ret; } @@ -64,7 +70,9 @@ public: get_uptime( ) { string s_ret; + pthread_mutex_lock ( &mut_s_uptime ); s_ret = this->s_uptime; + pthread_mutex_unlock( &mut_s_uptime ); return s_ret; } |
