Skip to content

Commit

Permalink
Merge pull request #1015 from xPaw/thread-names
Browse files Browse the repository at this point in the history
Name threads so they fit on Linux
  • Loading branch information
yaakov-h authored Aug 18, 2021
2 parents b2ff41e + c2150ae commit 3914019
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions SteamKit2/SteamKit2/Networking/Steam3/TcpConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ private void ConnectCompleted(bool success)
netReader = new BinaryReader(netStream);
netWriter = new BinaryWriter(netStream);

netThread = new Thread(NetLoop);
netThread.Name = "TcpConnection Thread";
netThread = new Thread( NetLoop )
{
Name = "SK2-TcpConn"
};

CurrentEndPoint = socket!.RemoteEndPoint;
}
Expand Down
6 changes: 4 additions & 2 deletions SteamKit2/SteamKit2/Networking/Steam3/UdpConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ public void Connect(EndPoint endPoint, int timeout)
inSeqAcked = 0;
inSeqHandled = 0;

netThread = new Thread(NetLoop);
netThread.Name = "UdpConnection Thread";
netThread = new Thread( NetLoop )
{
Name = "SK2-UdpConn"
};
netThread.Start(endPoint);
}

Expand Down
5 changes: 4 additions & 1 deletion SteamKit2/Tests/StreamHelpersFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ public void IsThreadSafe()

for ( var i = 0; i < threads.Length; i++)
{
threads[i] = new Thread(ThreadStart);
threads[ i ] = new Thread( ThreadStart )
{
Name = $"SK2-Test-{i}"
};
threads[i].Start(i);
}

Expand Down

0 comments on commit 3914019

Please sign in to comment.