mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-11-30 21:33:34 +08:00
6f9a8dbc1e
Use pthread_setspecific/pthread_getspecific to store/retrieve the thread environment block (TEB). Use pthread_once to trigger the creation of that data from within NtCurrentTeb. This allows us to get rid of the process environment block stuff which was only used to provide serialized access to a thread table in order to retrieve the TEB. NtCurrentTeb is currently only as a per-thread storage location for the last error value used by SetLastError and GetLastError. Also made the TestErrorSetLastError CTest a bit more demanding. It makes sure the 4 threads run for at least 2 seconds. Each thread constantly calls SetLastError with a random value and checks if GetLastError returns the same value again. The total amount of these iterations is calculated in order to measure the performance. This change increases the NtCurrentTeb performance by roughly 50% on linux and by several thousand percent (yes) on Mac OS X. Thanks for watching. |
||
---|---|---|
.. | ||
test | ||
CMakeLists.txt | ||
error.c | ||
module.def | ||
ModuleOptions.cmake |