FreeRDP/winpr/libwinpr/error
Norbert Federa 6f9a8dbc1e winpr: greatly improved NtCurrentTeb performance
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.
2013-10-11 19:34:23 +02:00
..
test winpr: greatly improved NtCurrentTeb performance 2013-10-11 19:34:23 +02:00
CMakeLists.txt libwinpr-nt: implement NtCurrentTeb() 2013-08-22 10:18:38 -04:00
error.c libwinpr-nt: implement NtCurrentTeb() 2013-08-22 10:18:38 -04:00
module.def libwinpr-error: fix windows build 2012-12-17 10:35:00 -05:00
ModuleOptions.cmake libwinpr-error: stub error API 2012-09-26 12:37:35 -04:00