From 6458fa0fce4bce7f3f9cccbacf9116f6f08abdf1 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Fri, 24 Sep 2010 07:57:37 -0700 Subject: 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 --- include/utils/ZipFileRO.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include/utils/ZipFileRO.h') diff --git a/include/utils/ZipFileRO.h b/include/utils/ZipFileRO.h index 97d31f4db4f3..9668bdeef55b 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 +#include +#include #include #include @@ -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; -- cgit v1.2.3-59-g8ed1b