-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Auto port System.Threading ACL comments #4147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<Type Name="EventWaitHandleAcl" FullName="System.Threading.EventWaitHandleAcl"> | ||
<Type Name="EventWaitHandleAcl" FullName="System.Threading.EventWaitHandleAcl"> | ||
<TypeSignature Language="C#" Value="public static class EventWaitHandleAcl" /> | ||
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit EventWaitHandleAcl extends System.Object" /> | ||
<TypeSignature Language="DocId" Value="T:System.Threading.EventWaitHandleAcl" /> | ||
|
@@ -41,14 +41,32 @@ | |
<Parameter Name="eventSecurity" Type="System.Security.AccessControl.EventWaitHandleSecurity" /> | ||
</Parameters> | ||
<Docs> | ||
<param name="initialState">To be added.</param> | ||
<param name="mode">To be added.</param> | ||
<param name="name">To be added.</param> | ||
<param name="createdNew">To be added.</param> | ||
<param name="eventSecurity">To be added.</param> | ||
<summary>To be added.</summary> | ||
<returns>To be added.</returns> | ||
<remarks>To be added.</remarks> | ||
<param name="initialState"> | ||
<see langword="true" /> to set the initial state to signaled if the named event is created as a result of this call; <see langword="false" /> to set it to non-signaled.</param> | ||
<param name="mode">One of the enum values that determines whether the event resets automatically or manually.</param> | ||
<param name="name">The name, if the event is to be shared with other processes; otherwise, <see langword="null" /> or an empty string.</param> | ||
<param name="createdNew">When this method returns, this argument is always set to <see langword="true" /> if a local event is created; that is, when <paramref name="name" /> is <see langword="null" /> or <see cref="F:System.String.Empty" />. If <paramref name="name" /> has a valid, non-empty value, this argument is set to <see langword="true" /> when the system event is created, or it is set to <see langword="false" /> if an existing system event is found with that name.</param> | ||
<param name="eventSecurity">The optional Windows access control security to apply.</param> | ||
<summary>Gets or creates an <see cref="T:System.Threading.EventWaitHandle" /> instance, allowing a <see cref="T:System.Security.AccessControl.EventWaitHandleSecurity" /> instance to be optionally specified to set it during the event creation.</summary> | ||
<returns>An object that represents an event wait handle as requested.</returns> | ||
<remarks> | ||
<format type="text/markdown"><![CDATA[ | ||
|
||
## Remarks | ||
|
||
If a `name` is passed and the system event already exists, the existing event is returned. If `name` is `null` or <xref:System.String.Empty>, a new process-local event is created. | ||
|
||
]]></format> | ||
</remarks> | ||
<exception cref="T:System.ArgumentException">.NET Framework only: The <paramref name="name" /> length is beyond MAX_PATH (260 characters). | ||
|
||
-or- | ||
|
||
.NET Framework only: The <paramref name="mode" /> enum value was out of legal range.</exception> | ||
<exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="mode" /> enum value was out of legal range.</exception> | ||
<exception cref="T:System.IO.DirectoryNotFoundException">Could not find a part of the path specified in <paramref name="name" />.</exception> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see this exception being raised by this API, the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unit test verifying this exception added here: https://github.com/dotnet/runtime/blob/25d316cefafc4c3884f38acf7bdef971d2b9fe4b/src/libraries/System.Threading.AccessControl/tests/EventWaitHandleAclTests.cs#L70-L84 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see thanks, I didn't know about that. If it can throw this exception for |
||
<exception cref="T:System.Threading.WaitHandleCannotBeOpenedException">A system-wide synchronization event with the provided <paramref name="name" /> was not found. | ||
-or- An <see cref="T:System.Threading.EventWaitHandle" /> with system-wide name <paramref name="name" /> cannot be created. An <see cref="T:System.Threading.EventWaitHandle" /> of a different type might have the same name.</exception> | ||
</Docs> | ||
</Member> | ||
</Members> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I see an
ArgumentException
thrown by .NET Framework,ArgumentOutOfRangeException
would make sense in this case but I'm wondering now if I'm seeing different docs on which this port was based (I'm currently looking at .NET Framework docs for the equivalent APIs).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.NET Core: https://github.com/dotnet/runtime/blob/8dc13298a89d50e64f24d0e755675bb01a33a399/src/libraries/System.Threading.AccessControl/src/System/Threading/EventWaitHandleAcl.cs#L35-L38
You're right, I should indicate another exception for Framework. I'll add it to the suggestion from the previous comment. https://referencesource.microsoft.com/#mscorlib/system/threading/eventwaithandle.cs,136
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm there are many inconsistencies between in-code docs, tests, and .NET Framework docs. Filed dotnet/runtime#35519 to fix those, I think following the XML docs is good for this PR.