[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]
Re: [MD:7046] MW32_update_begin でデッドロック
- X-ml-count: 7047
- Subject: Re: [MD:7046] MW32_update_begin でデッドロック
- From: Kyotaro HORIGUCHI <horiguti@xxxxxxxxxxx>
- Date: Fri, 25 Nov 2005 19:55:23 +0900 (JST)
- User-agent: Mew version 4.2.54 on Emacs 22.0 / Mule 5.0 (榊) / Meadow-3.00-dev (菊)
ご迷惑をおかけしてます.
とりあえず以下のパッチを当てたら状況は変わるでしょうか.
# CriticalSection の範囲を間違えていました.
> #0 0x77f82870 in ntdll!ZwWaitForSingleObject ()
> from /cygdrive/c/WINNT/system32/NTDLL.DLL
--
ほりぐちきょうたろう
Index: mw32term.c
===================================================================
--- mw32term.c (revision 3987)
+++ mw32term.c (working copy)
@@ -528,9 +528,27 @@
HDC *phdc;
int *pcount;
-
if (MW32_MAIN_THREAD_P ())
{
+ phdc = &f->output_data.mw32->hdc;
+ pcount = &f->output_data.mw32->hdc_refcount;
+ }
+ else
+ {
+ phdc = &f->output_data.mw32->message_thread_hdc;
+ pcount = &f->output_data.mw32->message_thread_hdc_refcount;
+ }
+
+ if (*phdc != INVALID_HANDLE_VALUE)
+ {
+ if (*pcount > GET_FRAME_HDC_LEVEL_LIMIT)
+ abort ();
+ (*pcount)++;
+ return;
+ }
+
+ if (MW32_MAIN_THREAD_P())
+ {
int block = FALSE;
if (W32_SELF_INPUT_BLOCKED_P)
@@ -540,30 +558,15 @@
}
EnterCriticalSection (&(f->output_data.mw32->hdc_critsec));
- phdc = &f->output_data.mw32->hdc;
+ *phdc = GetDC (FRAME_MW32_WINDOW (f));
LeaveCriticalSection (&(f->output_data.mw32->hdc_critsec));
if (block)
W32_BLOCK_INPUT;
-
- pcount = &f->output_data.mw32->hdc_refcount;
}
else
- {
- phdc = &f->output_data.mw32->message_thread_hdc;
- pcount = &f->output_data.mw32->message_thread_hdc_refcount;
- }
-
+ *phdc = GetDC (FRAME_MW32_WINDOW (f));
- if (*phdc != INVALID_HANDLE_VALUE)
- {
- if (*pcount > GET_FRAME_HDC_LEVEL_LIMIT)
- abort ();
- (*pcount)++;
- return;
- }
-
- *phdc = GetDC (FRAME_MW32_WINDOW (f));
*pcount = 1;
mw32_setup_default_hdc (*phdc);