Ryujinx/src/Ryujinx.HLE
jhorv 21e88f17f6
ServerBase thread safety (#4577)
* Add guard against ServerBase.Dispose() being called multiple times. Add reset event to avoid Dispose() being called while the ServerLoop is still running.

* remove unused usings

* rework ServerBase to use one collection each for sessions and ports, and make all accesses thread-safe.

* fix Logger call

* use GetSessionObj(int) instead of using _sessions directly

* move _threadStopped check inside "dispose once" test

* - Replace _threadStopped event with attempt to Join() the ending thread (if that isn't the current thread) instead.

- Use the instance-local _selfProcess and (new) _selfThread variables to avoid suggesting that the current KProcess and KThread could change. Per gdkchan, they can't currently, and this old IPC system will be removed before that changes.

- Re-order Dispose() so that the Interlocked _isDisposed check is the last check before disposing, to increase the likelihood that multiple callers will result in one of them succeeding.

* code style suggestions per AcK77

* add infinite wait for thread termination
2023-05-21 21:28:51 +02:00
..
Exceptions Move solution and projects to src 2023-04-27 23:51:14 +02:00
FileSystem Move solution and projects to src 2023-04-27 23:51:14 +02:00
HOS ServerBase thread safety (#4577) 2023-05-21 21:28:51 +02:00
Loaders misc: Avoid copy of ApplicationControlProperty (#4849) 2023-05-08 01:50:07 +02:00
Ui Move solution and projects to src 2023-04-27 23:51:14 +02:00
Utilities Move solution and projects to src 2023-04-27 23:51:14 +02:00
AssemblyInfo.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
HLEConfiguration.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
Homebrew.npdm Move solution and projects to src 2023-04-27 23:51:14 +02:00
MemoryConfiguration.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
PerformanceStatistics.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00
Ryujinx.HLE.csproj Move solution and projects to src 2023-04-27 23:51:14 +02:00
Switch.cs Move solution and projects to src 2023-04-27 23:51:14 +02:00