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
54de6994
Commit
54de6994
authored
Sep 06, 2004
by
Robert Shearman
Committed by
Alexandre Julliard
Sep 06, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve documentation for critical sections.
parent
c95959dc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
14 deletions
+73
-14
critsection.c
dlls/ntdll/critsection.c
+73
-14
No files found.
dlls/ntdll/critsection.c
View file @
54de6994
...
...
@@ -77,13 +77,18 @@ static inline HANDLE get_semaphore( RTL_CRITICAL_SECTION *crit )
/***********************************************************************
* RtlInitializeCriticalSection (NTDLL.@)
*
* Initialise
a new RTL_CRITICAL_SECTION
.
* Initialise
s a new critical section
.
*
* PARAMS
* crit [O] Critical section to initialise
*
* RETURN
* RETURN
S
* STATUS_SUCCESS.
*
* SEE
* RtlInitializeCriticalSectionAndSpinCount(), RtlDeleteCriticalSection(),
* RtlEnterCriticalSection(), RtlLeaveCriticalSection(),
* RtlTryEnterCriticalSection(), RtlSetCriticalSectionSpinCount()
*/
NTSTATUS
WINAPI
RtlInitializeCriticalSection
(
RTL_CRITICAL_SECTION
*
crit
)
{
...
...
@@ -93,7 +98,7 @@ NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit )
/***********************************************************************
* RtlInitializeCriticalSectionAndSpinCount (NTDLL.@)
*
* Initialise
a new RTL_CRITICAL_SECTION
with a given spin count.
* Initialise
s a new critical section
with a given spin count.
*
* PARAMS
* crit [O] Critical section to initialise
...
...
@@ -103,8 +108,12 @@ NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit )
* STATUS_SUCCESS.
*
* NOTES
* The InitializeCriticalSectionAndSpinCount() (KERNEL32) function is
* available on NT4SP3 or later, and Win98 or later.
* Available on NT4 SP3 or later.
*
* SEE
* RtlInitializeCriticalSection(), RtlDeleteCriticalSection(),
* RtlEnterCriticalSection(), RtlLeaveCriticalSection(),
* RtlTryEnterCriticalSection(), RtlSetCriticalSectionSpinCount()
*/
NTSTATUS
WINAPI
RtlInitializeCriticalSectionAndSpinCount
(
RTL_CRITICAL_SECTION
*
crit
,
ULONG
spincount
)
{
...
...
@@ -139,7 +148,7 @@ NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount( RTL_CRITICAL_SECTION *
* Sets the spin count of a critical section.
*
* PARAMS
* crit [O] Critical section
* crit [
I/
O] Critical section
* spincount [I] Spin count for crit
*
* RETURNS
...
...
@@ -147,6 +156,11 @@ NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount( RTL_CRITICAL_SECTION *
*
* NOTES
* If the system is not SMP, spincount is ignored and set to 0.
*
* SEE
* RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(),
* RtlDeleteCriticalSection(), RtlEnterCriticalSection(),
* RtlLeaveCriticalSection(), RtlTryEnterCriticalSection()
*/
ULONG
WINAPI
RtlSetCriticalSectionSpinCount
(
RTL_CRITICAL_SECTION
*
crit
,
ULONG
spincount
)
{
...
...
@@ -159,13 +173,18 @@ ULONG WINAPI RtlSetCriticalSectionSpinCount( RTL_CRITICAL_SECTION *crit, ULONG s
/***********************************************************************
* RtlDeleteCriticalSection (NTDLL.@)
*
* Free
the resources used by an RTL_CRITICAL_SECTION
.
* Free
s the resources used by a critical section
.
*
* PARAMS
* crit [I/O] Critical section to free
*
* RETURNS
* STATUS_SUCCESS.
*
* SEE
* RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(),
* RtlDeleteCriticalSection(), RtlEnterCriticalSection(),
* RtlLeaveCriticalSection(), RtlTryEnterCriticalSection()
*/
NTSTATUS
WINAPI
RtlDeleteCriticalSection
(
RTL_CRITICAL_SECTION
*
crit
)
{
...
...
@@ -190,13 +209,22 @@ NTSTATUS WINAPI RtlDeleteCriticalSection( RTL_CRITICAL_SECTION *crit )
/***********************************************************************
* RtlpWaitForCriticalSection (NTDLL.@)
*
* Wait
for an RTL_CRITICAL_SECTION
to become free.
* Wait
s for a busy critical section
to become free.
*
* PARAMS
* crit [I/O] Critical section to wait for
*
* RETURNS
* STATUS_SUCCESS.
*
* NOTES
* Use RtlEnterCriticalSection() instead of this function as it is often much
* faster.
*
* SEE
* RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(),
* RtlDeleteCriticalSection(), RtlEnterCriticalSection(),
* RtlLeaveCriticalSection(), RtlTryEnterCriticalSection()
*/
NTSTATUS
WINAPI
RtlpWaitForCriticalSection
(
RTL_CRITICAL_SECTION
*
crit
)
{
...
...
@@ -244,6 +272,25 @@ NTSTATUS WINAPI RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit )
/***********************************************************************
* RtlpUnWaitCriticalSection (NTDLL.@)
*
* Notifies other threads waiting on the busy critical section that it has
* become free.
*
* PARAMS
* crit [I/O] Critical section
*
* RETURNS
* Success: STATUS_SUCCESS.
* Failure: Any error returned by NtReleaseSemaphore()
*
* NOTES
* Use RtlLeaveCriticalSection() instead of this function as it is often much
* faster.
*
* SEE
* RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(),
* RtlDeleteCriticalSection(), RtlEnterCriticalSection(),
* RtlLeaveCriticalSection(), RtlTryEnterCriticalSection()
*/
NTSTATUS
WINAPI
RtlpUnWaitCriticalSection
(
RTL_CRITICAL_SECTION
*
crit
)
{
...
...
@@ -257,7 +304,7 @@ NTSTATUS WINAPI RtlpUnWaitCriticalSection( RTL_CRITICAL_SECTION *crit )
/***********************************************************************
* RtlEnterCriticalSection (NTDLL.@)
*
* Enter
an RTL_CRITICAL_SECTION
.
* Enter
s a critical section, waiting for it to become available if necessary
.
*
* PARAMS
* crit [I/O] Critical section to enter
...
...
@@ -265,8 +312,10 @@ NTSTATUS WINAPI RtlpUnWaitCriticalSection( RTL_CRITICAL_SECTION *crit )
* RETURNS
* STATUS_SUCCESS. The critical section is held by the caller.
*
* NOTES
* The caller will wait until the critical section is availale.
* SEE
* RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(),
* RtlDeleteCriticalSection(), RtlSetCriticalSectionSpinCount(),
* RtlLeaveCriticalSection(), RtlTryEnterCriticalSection()
*/
NTSTATUS
WINAPI
RtlEnterCriticalSection
(
RTL_CRITICAL_SECTION
*
crit
)
{
...
...
@@ -307,7 +356,7 @@ done:
/***********************************************************************
* RtlTryEnterCriticalSection (NTDLL.@)
*
*
Enter an RTL_CRITICAL_SECTION
without waiting.
*
Tries to enter a critical section
without waiting.
*
* PARAMS
* crit [I/O] Critical section to enter
...
...
@@ -315,6 +364,11 @@ done:
* RETURNS
* Success: TRUE. The critical section is held by the caller.
* Failure: FALSE. The critical section is currently held by another thread.
*
* SEE
* RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(),
* RtlDeleteCriticalSection(), RtlEnterCriticalSection(),
* RtlLeaveCriticalSection(), RtlSetCriticalSectionSpinCount()
*/
BOOL
WINAPI
RtlTryEnterCriticalSection
(
RTL_CRITICAL_SECTION
*
crit
)
{
...
...
@@ -338,13 +392,18 @@ BOOL WINAPI RtlTryEnterCriticalSection( RTL_CRITICAL_SECTION *crit )
/***********************************************************************
* RtlLeaveCriticalSection (NTDLL.@)
*
* Leave
an RTL_CRITICAL_SECTION
.
* Leave
s a critical section
.
*
* PARAMS
* crit [I/O] Critical section to
enter
* crit [I/O] Critical section to
leave.
*
* RETURNS
* STATUS_SUCCESS.
*
* SEE
* RtlInitializeCriticalSection(), RtlInitializeCriticalSectionAndSpinCount(),
* RtlDeleteCriticalSection(), RtlEnterCriticalSection(),
* RtlSetCriticalSectionSpinCount(), RtlTryEnterCriticalSection()
*/
NTSTATUS
WINAPI
RtlLeaveCriticalSection
(
RTL_CRITICAL_SECTION
*
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