archive/{iso9660,zzip}: unlock the mutex during I/O
Similar to commit 31ab78ae8e
This commit is contained in:
parent
4b18460bc6
commit
d094c168aa
1
NEWS
1
NEWS
|
@ -3,6 +3,7 @@ ver 0.20.14 (not yet released)
|
||||||
- simple: fix file corruption in the presence of mount points
|
- simple: fix file corruption in the presence of mount points
|
||||||
* archive
|
* archive
|
||||||
- bz2: fix deadlock
|
- bz2: fix deadlock
|
||||||
|
- reduce lock contention, fixing lots of xrun problems
|
||||||
* fix Solaris build failure
|
* fix Solaris build failure
|
||||||
|
|
||||||
ver 0.20.13 (2017/12/18)
|
ver 0.20.13 (2017/12/18)
|
||||||
|
|
|
@ -182,6 +182,8 @@ Iso9660ArchiveFile::OpenStream(const char *pathname,
|
||||||
size_t
|
size_t
|
||||||
Iso9660InputStream::Read(void *ptr, size_t read_size)
|
Iso9660InputStream::Read(void *ptr, size_t read_size)
|
||||||
{
|
{
|
||||||
|
const ScopeUnlock unlock(mutex);
|
||||||
|
|
||||||
int readed = 0;
|
int readed = 0;
|
||||||
int no_blocks, cur_block;
|
int no_blocks, cur_block;
|
||||||
size_t left_bytes = statbuf->size - offset;
|
size_t left_bytes = statbuf->size - offset;
|
||||||
|
|
|
@ -138,6 +138,8 @@ ZzipArchiveFile::OpenStream(const char *pathname,
|
||||||
size_t
|
size_t
|
||||||
ZzipInputStream::Read(void *ptr, size_t read_size)
|
ZzipInputStream::Read(void *ptr, size_t read_size)
|
||||||
{
|
{
|
||||||
|
const ScopeUnlock unlock(mutex);
|
||||||
|
|
||||||
int ret = zzip_file_read(file, ptr, read_size);
|
int ret = zzip_file_read(file, ptr, read_size);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
throw std::runtime_error("zzip_file_read() has failed");
|
throw std::runtime_error("zzip_file_read() has failed");
|
||||||
|
@ -155,6 +157,8 @@ ZzipInputStream::IsEOF() noexcept
|
||||||
void
|
void
|
||||||
ZzipInputStream::Seek(offset_type new_offset)
|
ZzipInputStream::Seek(offset_type new_offset)
|
||||||
{
|
{
|
||||||
|
const ScopeUnlock unlock(mutex);
|
||||||
|
|
||||||
zzip_off_t ofs = zzip_seek(file, new_offset, SEEK_SET);
|
zzip_off_t ofs = zzip_seek(file, new_offset, SEEK_SET);
|
||||||
if (ofs < 0)
|
if (ofs < 0)
|
||||||
throw std::runtime_error("zzip_seek() has failed");
|
throw std::runtime_error("zzip_seek() has failed");
|
||||||
|
|
Loading…
Reference in New Issue