summaryrefslogtreecommitdiffstats
path: root/opengl/libs/EGL/egl_cache.h
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2011-11-08 17:59:36 -0800
committerJamie Gennis <jgennis@google.com>2011-11-08 17:59:36 -0800
commit2ea0cbb3d14ec82b1728ca6a1caa4f3f458814ef (patch)
tree233849eecc19690131c292aaf6966cfb98733ba5 /opengl/libs/EGL/egl_cache.h
parentd211b4882a662409b85a1f90c71e28faa9c54464 (diff)
downloadframeworks_base-2ea0cbb3d14ec82b1728ca6a1caa4f3f458814ef.zip
frameworks_base-2ea0cbb3d14ec82b1728ca6a1caa4f3f458814ef.tar.gz
frameworks_base-2ea0cbb3d14ec82b1728ca6a1caa4f3f458814ef.tar.bz2
EGL: add deferred saving of the cache
This change causes any insertions into the EGL cache to trigger an attempt to save the cache contents to disk. The save operation is deferred to allow multiple cache insertions to be batched up. Change-Id: I6cfec9c0dbbef94d3f8880860e2a365dccc296c7
Diffstat (limited to 'opengl/libs/EGL/egl_cache.h')
-rw-r--r--opengl/libs/EGL/egl_cache.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/opengl/libs/EGL/egl_cache.h b/opengl/libs/EGL/egl_cache.h
index 05d5873..4389623 100644
--- a/opengl/libs/EGL/egl_cache.h
+++ b/opengl/libs/EGL/egl_cache.h
@@ -108,6 +108,13 @@ private:
// from disk.
String8 mFilename;
+ // mSavePending indicates whether or not a deferred save operation is
+ // pending. Each time a key/value pair is inserted into the cache via
+ // setBlob, a deferred save is initiated if one is not already pending.
+ // This will wait some amount of time and then trigger a save of the cache
+ // contents to disk.
+ bool mSavePending;
+
// mMutex is the mutex used to prevent concurrent access to the member
// variables. It must be locked whenever the member variables are accessed.
mutable Mutex mMutex;