summaryrefslogtreecommitdiffstats
path: root/src/call_history.h
diff options
context:
space:
mode:
authorLubos Dolezel <lubos@dolezel.info>2015-07-07 23:08:03 +0200
committerLubos Dolezel <lubos@dolezel.info>2015-07-07 23:08:03 +0200
commit38bb6b72da1d3f5cfa4c72d8bc9597229423c0e3 (patch)
tree14186c138dbd8c90dc94f41484c4d1b2ac1d7818 /src/call_history.h
parentea71ccfcfab52f74469231cab4e70552333b590a (diff)
downloadtwinkle-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.h10
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. */