Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit aef18a7

Browse files
committed
Merge pull request #2142 from VSadov/threadID
Check for state before fetching threadID
2 parents f258164 + c27dca7 commit aef18a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/System.Linq/src/System/Linq/Enumerable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public virtual void Dispose()
100100

101101
public IEnumerator<TSource> GetEnumerator()
102102
{
103-
if (_threadId == Environment.CurrentManagedThreadId && state == 0)
103+
if (state == 0 && _threadId == Environment.CurrentManagedThreadId)
104104
{
105105
state = 1;
106106
return this;

0 commit comments

Comments
 (0)