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
79762059
Commit
79762059
authored
Apr 18, 1999
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added timeout to critical section waiting.
parent
a44f9f8e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
critsection.c
scheduler/critsection.c
+10
-2
No files found.
scheduler/critsection.c
View file @
79762059
...
@@ -53,6 +53,8 @@ void WINAPI DeleteCriticalSection( CRITICAL_SECTION *crit )
...
@@ -53,6 +53,8 @@ void WINAPI DeleteCriticalSection( CRITICAL_SECTION *crit )
*/
*/
void
WINAPI
EnterCriticalSection
(
CRITICAL_SECTION
*
crit
)
void
WINAPI
EnterCriticalSection
(
CRITICAL_SECTION
*
crit
)
{
{
DWORD
res
;
if
(
!
crit
->
LockSemaphore
)
if
(
!
crit
->
LockSemaphore
)
{
{
FIXME
(
win32
,
"entering uninitialized section(%p)?
\n
"
,
crit
);
FIXME
(
win32
,
"entering uninitialized section(%p)?
\n
"
,
crit
);
...
@@ -66,8 +68,14 @@ void WINAPI EnterCriticalSection( CRITICAL_SECTION *crit )
...
@@ -66,8 +68,14 @@ void WINAPI EnterCriticalSection( CRITICAL_SECTION *crit )
return
;
return
;
}
}
/* Now wait for it */
/* Now wait for it */
/* FIXME: should set a timeout and raise an exception */
WaitForSingleObject
(
crit
->
LockSemaphore
,
INFINITE
);
res
=
WaitForSingleObject
(
crit
->
LockSemaphore
,
2000
);
if
(
res
==
STATUS_TIMEOUT
)
res
=
WaitForSingleObject
(
crit
->
LockSemaphore
,
2000
);
if
(
res
!=
STATUS_WAIT_0
)
{
ERR
(
win32
,
"Critical section %p wait failed err=%lx
\n
"
,
crit
,
res
);
/* FIXME: should raise an exception */
}
}
}
crit
->
OwningThread
=
GetCurrentThreadId
();
crit
->
OwningThread
=
GetCurrentThreadId
();
crit
->
RecursionCount
=
1
;
crit
->
RecursionCount
=
1
;
...
...
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