summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-30 11:48:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-30 17:54:32 +0200
commit4bf1fbc9572741c665ae200303e929d908896820 (patch)
tree40db695b487734ecdd82eb076d1ebbc1436689b5 /package
parentf1600c169bd2114505344a100cdc383539f76dbc (diff)
tsan:data race in XBufferedThreadedStream
cannot read from maInUseBuffer without holding the lock Change-Id: I4244e1132595a18c1a7ab33803e10b6c29684bf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119707 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package')
-rw-r--r--package/source/zipapi/XBufferedThreadedStream.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/package/source/zipapi/XBufferedThreadedStream.cxx b/package/source/zipapi/XBufferedThreadedStream.cxx
index ceb5f6895ba1..c36a1845be6c 100644
--- a/package/source/zipapi/XBufferedThreadedStream.cxx
+++ b/package/source/zipapi/XBufferedThreadedStream.cxx
@@ -93,10 +93,10 @@ void XBufferedThreadedStream::produce()
*/
const Buffer& XBufferedThreadedStream::getNextBlock()
{
+ std::unique_lock<std::mutex> aGuard( maBufferProtector );
const sal_Int32 nBufSize = maInUseBuffer.getLength();
if( nBufSize <= 0 || mnOffset >= nBufSize )
{
- std::unique_lock<std::mutex> aGuard( maBufferProtector );
if( mnOffset >= nBufSize )
maUsedBuffers.push( maInUseBuffer );