diff options
author | Lubos Dolezel <lubos@dolezel.info> | 2015-07-07 23:08:03 +0200 |
---|---|---|
committer | Lubos Dolezel <lubos@dolezel.info> | 2015-07-07 23:08:03 +0200 |
commit | 38bb6b72da1d3f5cfa4c72d8bc9597229423c0e3 (patch) | |
tree | 14186c138dbd8c90dc94f41484c4d1b2ac1d7818 /src/call_history.h | |
parent | ea71ccfcfab52f74469231cab4e70552333b590a (diff) | |
download | twinkle-38bb6b72da1d3f5cfa4c72d8bc9597229423c0e3.tar twinkle-38bb6b72da1d3f5cfa4c72d8bc9597229423c0e3.tar.gz twinkle-38bb6b72da1d3f5cfa4c72d8bc9597229423c0e3.tar.lz twinkle-38bb6b72da1d3f5cfa4c72d8bc9597229423c0e3.tar.xz twinkle-38bb6b72da1d3f5cfa4c72d8bc9597229423c0e3.zip |
Partial lock rework in t_phone (#17). If the app starts crashing or freezing, this commit is probably to blame.
Diffstat (limited to 'src/call_history.h')
-rw-r--r-- | src/call_history.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/call_history.h b/src/call_history.h index b7fd3b6..93db6be 100644 --- a/src/call_history.h +++ b/src/call_history.h @@ -82,6 +82,12 @@ public: /** Constructor. */ t_call_record(); + + /** Copy constructor */ + t_call_record(const t_call_record& that); + + /** Assignment operator */ + t_call_record& operator=(const t_call_record& that); /** * Clear current settings and get a new record id. @@ -177,6 +183,10 @@ public: /** Get the record id. */ unsigned short get_id(void) const; +private: + // Guarded by a mutex, because contents of this class are updated from other threads. + // The main thread always creates a copy (snapshot) of current state. + mutable t_mutex mutex; }; /** History of calls. */ |