From aef050626d6412bffa292cbfcee23107cadc4b5d Mon Sep 17 00:00:00 2001 From: "rvargas@google.com" Date: Thu, 21 Aug 2008 01:34:16 +0000 Subject: Fix WaitForPendingIO to actually exit the wait at some point. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1143 0039d316-1c4b-4281-b951-d872f2087c98 --- net/disk_cache/backend_impl.cc | 2 +- net/disk_cache/cache_util.h | 2 +- net/disk_cache/cache_util_posix.cc | 4 ++-- net/disk_cache/cache_util_win.cc | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'net/disk_cache') diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index 74eabbc..9b15d5e 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -262,7 +262,7 @@ BackendImpl::~BackendImpl() { delete timer_; delete timer_task_; - WaitForPendingIO(num_pending_io_); + WaitForPendingIO(&num_pending_io_); DCHECK(!num_refs_); } diff --git a/net/disk_cache/cache_util.h b/net/disk_cache/cache_util.h index dcb82c2..dd14379 100644 --- a/net/disk_cache/cache_util.h +++ b/net/disk_cache/cache_util.h @@ -55,7 +55,7 @@ void DeleteCache(const std::wstring& path, bool remove_folder); bool DeleteCacheFile(const std::wstring& name); // Blocks until |num_pending_io| IO operations complete. -void WaitForPendingIO(int num_pending_io); +void WaitForPendingIO(int* num_pending_io); } // namespace disk_cache diff --git a/net/disk_cache/cache_util_posix.cc b/net/disk_cache/cache_util_posix.cc index a6055fa..7eed9dd 100644 --- a/net/disk_cache/cache_util_posix.cc +++ b/net/disk_cache/cache_util_posix.cc @@ -64,8 +64,8 @@ bool DeleteCacheFile(const std::wstring& name) { return file_util::Delete(name, false); } -void WaitForPendingIO(int num_pending_io) { - if (num_pending_io) { +void WaitForPendingIO(int* num_pending_io) { + if (*num_pending_io) { NOTIMPLEMENTED(); } } diff --git a/net/disk_cache/cache_util_win.cc b/net/disk_cache/cache_util_win.cc index cb38b5f..2c1457c 100644 --- a/net/disk_cache/cache_util_win.cc +++ b/net/disk_cache/cache_util_win.cc @@ -111,8 +111,8 @@ bool DeleteCacheFile(const std::wstring& name) { return DeleteFile(name.c_str()) ? true : false; } -void WaitForPendingIO(int num_pending_io) { - while (num_pending_io) { +void WaitForPendingIO(int* num_pending_io) { + while (*num_pending_io) { // Asynchronous IO operations may be in flight and the completion may end // up calling us back so let's wait for them (we need an alertable wait). // The idea is to let other threads do usefull work and at the same time -- cgit v1.1