Skip to content

Commit

Permalink
Make Uri Thread-Safe (#33042)
Browse files Browse the repository at this point in the history
* Do not lock on string in Uri

* Make Uri thread-safe without locks

*A lock may still be used for custom parsers

* Update comments

* Use existing style for enum values

* Add a comment about locking for custom parsers

* Add a comment about DebugSetLeftCtor usage

* Add trailing dot in exception message

* Fix typos

* Fix typo

Co-authored-by: Stephen Toub <[email protected]>

Co-authored-by: Stephen Toub <[email protected]>
  • Loading branch information
MihaZupan and stephentoub authored May 9, 2020
1 parent 6b5850f commit e18250b
Show file tree
Hide file tree
Showing 7 changed files with 269 additions and 126 deletions.
6 changes: 5 additions & 1 deletion src/libraries/System.Private.Uri/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<root>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -191,4 +192,7 @@
<data name="Arg_KeyNotFoundWithKey" xml:space="preserve">
<value>The given key '{0}' was not present in the dictionary.</value>
</data>
<data name="net_uri_InitializeCalledAlreadyOrTooLate" xml:space="preserve">
<value>UriParser's base InitializeAndValidate may only be called once on a single Uri instance and only from an override of InitializeAndValidate.</value>
</data>
</root>
Loading

0 comments on commit e18250b

Please sign in to comment.