[Wine-patches] kernel32: Do not add delay if offset is changed.

Alexander Morozov amorozov на etersoft.ru
Пт Июл 3 13:02:09 MSD 2009


----------- следующая часть -----------
From 777dc1d38903460e7a708f95ecec0ce719a79f68 Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Fri, 3 Jul 2009 12:58:07 +0400
Subject: [PATCH] kernel32: Do not add delay if offset is changed.

---
 dlls/kernel32/file.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index dad1a92..33183cd 100644
--- a/dlls/kernel32/file.c
+++ b/dlls/kernel32/file.c
@@ -1121,14 +1121,19 @@ BOOL WINAPI LockFile( HANDLE hFile, DWORD offset_low, DWORD offset_high,
         (see https://bugs.etersoft.ru/show_bug.cgi?id=2854) */
         if (status == ERROR_LOCK_VIOLATION) {
             static HANDLE prevHandle;
+            static DWORD prev_off_low;
+            static DWORD prev_off_high;
             static int sleep = 100;
-            if (prevHandle == hFile) {
+            if (prevHandle == hFile && prev_off_low == offset_low &&
+                prev_off_high == offset_high) {
                 /* Sleep for second try */
                 SleepEx(sleep, FALSE);
                 if (sleep < 1000)
                     sleep *= 2;
             } else {
                 prevHandle = hFile;
+                prev_off_low = offset_low;
+                prev_off_high = offset_high;
                 sleep = 100;
             }
         }
-- 
1.6.3.3



Подробная информация о списке рассылки Wine-patches