Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6f1b6424
Commit
6f1b6424
authored
Nov 24, 1999
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Raise an exception when a critical section wait failed.
parent
4d715fd9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
14 deletions
+29
-14
dbg.y
debugger/dbg.y
+3
-0
winbase.h
include/winbase.h
+2
-0
critsection.c
scheduler/critsection.c
+24
-14
No files found.
debugger/dbg.y
View file @
6f1b6424
...
...
@@ -693,6 +693,9 @@ DWORD wine_debugger( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance
case CONTROL_C_EXIT:
fprintf( stderr, "^C" );
break;
case EXCEPTION_CRITICAL_SECTION_WAIT:
fprintf( stderr, "critical section %08lx wait failed", rec->ExceptionInformation[0] );
break;
default:
fprintf( stderr, "%08lx", rec->ExceptionCode );
break;
...
...
include/winbase.h
View file @
6f1b6424
...
...
@@ -973,6 +973,8 @@ typedef DWORD (WINAPI *LPPROGRESS_ROUTINE)(LARGE_INTEGER, LARGE_INTEGER, LARGE_I
#define EXCEPTION_INVALID_HANDLE STATUS_INVALID_HANDLE
#define CONTROL_C_EXIT STATUS_CONTROL_C_EXIT
/* Wine extension; Windows doesn't have a name for this code */
#define EXCEPTION_CRITICAL_SECTION_WAIT 0xc0000194
#define DUPLICATE_CLOSE_SOURCE 0x00000001
#define DUPLICATE_SAME_ACCESS 0x00000002
...
...
scheduler/critsection.c
View file @
6f1b6424
...
...
@@ -10,6 +10,7 @@
#include <sys/types.h>
#include "winerror.h"
#include "winbase.h"
#include "ntddk.h"
#include "heap.h"
#include "debugtools.h"
#include "thread.h"
...
...
@@ -78,21 +79,30 @@ void WINAPI EnterCriticalSection( CRITICAL_SECTION *crit )
}
/* Now wait for it */
res
=
WaitForSingleObject
(
crit
->
LockSemaphore
,
5000L
);
if
(
res
==
WAIT_TIMEOUT
)
for
(;;)
{
ERR_
(
win32
)(
"Critical section %p wait timed out, retrying (60 sec)
\n
"
,
crit
);
res
=
WaitForSingleObject
(
crit
->
LockSemaphore
,
60000L
);
}
if
(
res
==
WAIT_TIMEOUT
&&
TRACE_ON
(
relay
)
)
{
ERR_
(
win32
)(
"Critical section %p wait timed out, retrying (5 min)
\n
"
,
crit
);
res
=
WaitForSingleObject
(
crit
->
LockSemaphore
,
300000L
);
}
if
(
res
!=
STATUS_WAIT_0
)
{
ERR_
(
win32
)(
"Critical section %p wait failed err=%lx
\n
"
,
crit
,
res
);
/* FIXME: should raise an exception */
EXCEPTION_RECORD
rec
;
res
=
WaitForSingleObject
(
crit
->
LockSemaphore
,
5000L
);
if
(
res
==
WAIT_TIMEOUT
)
{
ERR_
(
win32
)(
"Critical section %p wait timed out, retrying (60 sec)
\n
"
,
crit
);
res
=
WaitForSingleObject
(
crit
->
LockSemaphore
,
60000L
);
if
(
res
==
WAIT_TIMEOUT
&&
TRACE_ON
(
relay
)
)
{
ERR_
(
win32
)(
"Critical section %p wait timed out, retrying (5 min)
\n
"
,
crit
);
res
=
WaitForSingleObject
(
crit
->
LockSemaphore
,
300000L
);
}
}
if
(
res
==
STATUS_WAIT_0
)
break
;
rec
.
ExceptionCode
=
EXCEPTION_CRITICAL_SECTION_WAIT
;
rec
.
ExceptionFlags
=
0
;
rec
.
ExceptionRecord
=
NULL
;
rec
.
ExceptionAddress
=
RtlRaiseException
;
/* sic */
rec
.
NumberParameters
=
1
;
rec
.
ExceptionInformation
[
0
]
=
(
DWORD
)
crit
;
RtlRaiseException
(
&
rec
);
}
}
crit
->
OwningThread
=
GetCurrentThreadId
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment