summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-09-24 07:57:37 -0700
committerKenny Root <kroot@google.com>2010-09-24 08:05:51 -0700
commitfa98920b7192d0db8d22d9345b750810f89f9cdd (patch)
tree02cc29209b34f0c8e57963b7c7e22f9382276a55 /include
parent8aa24c202f386113af0633f6ddca438403269bdd (diff)
downloadframeworks_native-fa98920b7192d0db8d22d9345b750810f89f9cdd.zip
frameworks_native-fa98920b7192d0db8d22d9345b750810f89f9cdd.tar.gz
frameworks_native-fa98920b7192d0db8d22d9345b750810f89f9cdd.tar.bz2
Add locking around ZIP seeking
Since we switched to seeking to the LFH to verify its existence instead of a huge mmap of the file, we have to guarantee that another seek doesn't happen before we finish our read on the LFH. Change-Id: If8135d9cb6f2f5cc4db734eafa4f6b5f6269c62a
Diffstat (limited to 'include')
-rw-r--r--include/utils/ZipFileRO.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/utils/ZipFileRO.h b/include/utils/ZipFileRO.h
index 97d31f4..9668bde 100644
--- a/include/utils/ZipFileRO.h
+++ b/include/utils/ZipFileRO.h
@@ -24,8 +24,9 @@
#ifndef __LIBS_ZIPFILERO_H
#define __LIBS_ZIPFILERO_H
-#include "Errors.h"
-#include "FileMap.h"
+#include <utils/Errors.h>
+#include <utils/FileMap.h>
+#include <utils/threads.h>
#include <stdio.h>
#include <stdlib.h>
@@ -211,6 +212,9 @@ private:
/* open Zip archive */
int mFd;
+ /* Lock for handling the file descriptor (seeks, etc) */
+ mutable Mutex mFdLock;
+
/* zip file name */
char* mFileName;