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
4b155749
Commit
4b155749
authored
Sep 10, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented RtlpWaitForCriticalSection and RtlpUnWaitCriticalSection.
parent
c4a26442
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
30 deletions
+48
-30
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-2
critsection.c
scheduler/critsection.c
+46
-28
No files found.
dlls/ntdll/ntdll.spec
View file @
4b155749
...
...
@@ -550,8 +550,8 @@ type win32
@ stub RtlpNtOpenKey
@ stub RtlpNtQueryValueKey
@ stub RtlpNtSetValueKey
@ st
ub
RtlpUnWaitCriticalSection
@ st
ub
RtlpWaitForCriticalSection
@ st
dcall RtlpUnWaitCriticalSection(ptr)
RtlpUnWaitCriticalSection
@ st
dcall RtlpWaitForCriticalSection(ptr)
RtlpWaitForCriticalSection
@ stdcall RtlxAnsiStringToUnicodeSize(ptr) RtlAnsiStringToUnicodeSize
@ stdcall RtlxOemStringToUnicodeSize(ptr) RtlOemStringToUnicodeSize
@ stdcall RtlxUnicodeStringToAnsiSize(ptr) RtlUnicodeStringToAnsiSize
...
...
scheduler/critsection.c
View file @
4b155749
...
...
@@ -65,6 +65,50 @@ void WINAPI DeleteCriticalSection( CRITICAL_SECTION *crit )
/***********************************************************************
* RtlpWaitForCriticalSection (NTDLL.@)
*/
void
WINAPI
RtlpWaitForCriticalSection
(
CRITICAL_SECTION
*
crit
)
{
for
(;;)
{
EXCEPTION_RECORD
rec
;
HANDLE
sem
=
get_semaphore
(
crit
);
DWORD
res
=
WaitForSingleObject
(
sem
,
5000L
);
if
(
res
==
WAIT_TIMEOUT
)
{
ERR
(
"Critical section %p wait timed out, retrying (60 sec)
\n
"
,
crit
);
res
=
WaitForSingleObject
(
sem
,
60000L
);
if
(
res
==
WAIT_TIMEOUT
&&
TRACE_ON
(
relay
)
)
{
ERR
(
"Critical section %p wait timed out, retrying (5 min)
\n
"
,
crit
);
res
=
WaitForSingleObject
(
sem
,
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
);
}
}
/***********************************************************************
* RtlpUnWaitCriticalSection (NTDLL.@)
*/
void
WINAPI
RtlpUnWaitCriticalSection
(
CRITICAL_SECTION
*
crit
)
{
HANDLE
sem
=
get_semaphore
(
crit
);
ReleaseSemaphore
(
sem
,
1
,
NULL
);
}
/***********************************************************************
* EnterCriticalSection (KERNEL32.195) (NTDLL.344)
*/
void
WINAPI
EnterCriticalSection
(
CRITICAL_SECTION
*
crit
)
...
...
@@ -78,32 +122,7 @@ void WINAPI EnterCriticalSection( CRITICAL_SECTION *crit )
}
/* Now wait for it */
for
(;;)
{
EXCEPTION_RECORD
rec
;
HANDLE
sem
=
get_semaphore
(
crit
);
DWORD
res
=
WaitForSingleObject
(
sem
,
5000L
);
if
(
res
==
WAIT_TIMEOUT
)
{
ERR
(
"Critical section %p wait timed out, retrying (60 sec)
\n
"
,
crit
);
res
=
WaitForSingleObject
(
sem
,
60000L
);
if
(
res
==
WAIT_TIMEOUT
&&
TRACE_ON
(
relay
)
)
{
ERR
(
"Critical section %p wait timed out, retrying (5 min)
\n
"
,
crit
);
res
=
WaitForSingleObject
(
sem
,
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
);
}
RtlpWaitForCriticalSection
(
crit
);
}
crit
->
OwningThread
=
GetCurrentThreadId
();
crit
->
RecursionCount
=
1
;
...
...
@@ -149,8 +168,7 @@ void WINAPI LeaveCriticalSection( CRITICAL_SECTION *crit )
if
(
InterlockedDecrement
(
&
crit
->
LockCount
)
>=
0
)
{
/* Someone is waiting */
HANDLE
sem
=
get_semaphore
(
crit
);
ReleaseSemaphore
(
sem
,
1
,
NULL
);
RtlpUnWaitCriticalSection
(
crit
);
}
}
...
...
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