Commit Graph

22 Commits

Author SHA1 Message Date
Norbert Federa
c16bee759f winpr: several pool and synch fixes
pool:
- the winpr implementation fallback was not used on older windows editions
- drop useless and conflicting TP_CALLBACK_ENVIRON_V3
- fix race conditions by using use proper one-time initialization
- on win32 WinPR tried to load several pool/callback_environment functions
  from kernel32.dll but since these are defined as inline functions in the
  windows headers, no windows edition has ever exported them in any dll.
- removed callback_environment.c and added corresponding static inline
  function to pool.h
- fix segfault in TestPoolWork: CloseThreadpoolWork() must not be called
  if there is a cleanup group associated with the work object since calling
  CloseThreadpoolCleanupGroupMember() already releases the work object

sync:
- The windows headers incorrectly define InitializeCriticalEx support if
  _WIN32_WINNT >= 0x0403 instead of >= 0x0600 (Vista)
- created a compatible define to deal with this issue
2016-06-04 17:09:48 +02:00
Marc-André Moreau
2f5d159448 winpr: fix WinXP backwards compatibility 2015-11-25 13:46:10 -05:00
Bernhard Miklautz
3c7662517c hardening
Start to add missing checks for:
* *alloc
* *_New
2015-03-25 17:38:21 +01:00
Marc-André Moreau
85191391d5 libfreerdp-core: simplify TS Gateway RPC fragment receiving 2015-01-31 16:56:25 -05:00
Armin Novak
b22b897389 Reformatted changed files. 2014-09-09 16:32:22 +02:00
Armin Novak
7e3a1b3073 Now using macro to generate module specific log tag. 2014-09-09 16:32:04 +02:00
Armin Novak
28ece6bb46 Replaced stdio logging with WLog 2014-09-09 16:31:46 +02:00
Bernhard Miklautz
b8415af0d8 Fix compiler warnings.
This commit is based on pull request #1493
2014-07-29 05:22:29 +02:00
Marc-André Moreau
e6f4754ed3 winpr: improve windows builds across visual studio versions and toolsets 2014-07-17 15:11:04 -04:00
Marc-André Moreau
a202fe4057 freerdp: fix several type related warnings 2014-05-08 18:02:02 -04:00
Alessandro Pilotti
9d6dcab3c6 Fixes build issue on Windows
Solves the following build issue:

error C2373: 'InitializeCriticalSectionEx' : redefinition;
different type modifiers
2014-01-28 01:09:14 +02:00
Bernhard Miklautz
2b6b4a6685 updated file headers 2013-12-04 11:44:22 +01:00
Marc-André Moreau
e8a8c1cf7f winpr: fix crashing tests 2013-09-19 14:17:00 -04:00
Marc-André Moreau
0c17eb1a23 winpr: fix unit tests on Windows 2013-09-19 13:50:00 -04:00
Norbert Federa
2b25b4a520 libwinpr-sync: New complete critical section code
- Complete implementation including recursion support
- Added an intensive ctest (TestSynchCritical)
- Struct members are used exactly as Windows does it internally:
  LockCount starts at -1, RecursionCount at 0
- Same performance optimizations as internally on Windows:
    - Fast lock acquisition path using CAS -> SpinCount -> wait
    - SpinCount automatically disabled on uniprocessor systems
- On Linux SpinCount is disabled because it provided no advantage over NPTL/futex in all tests

Support for CRITICAL_SECTION's DebugInfo is not yet included (but trivial to add).
2013-08-07 10:20:04 +02:00
Norbert Federa
81ef251fc8 winpr: improve and fix locking for data structures
- Improved/completed(almost) winpr's critical section implementation
- Replaced WaitForSingleObject locking with critical sections

Note:
WaitForSingleObject should _never_ be used for granular low-contention
locks as it _always_ enters the kernel.

Just replacing WaitForSingleObject locking in Bufferpool with
EnterCriticalSection boosts the multithreaded rfx decoder
performance by almost 400% on win32.
2013-08-02 12:07:05 +02:00
Marc-André Moreau
d8fa43c526 libwinpr-synch: fix race condition in event handling 2012-12-03 14:57:15 -05:00
Marc-André Moreau
4bd217055c libwinpr-synch: implemented Win32 Events 2012-09-18 18:36:13 -04:00
Marc-André Moreau
78723f019f libwinpr-synch: stubbed more 2012-09-18 15:51:33 -04:00
Marc-André Moreau
deec68be19 libwinpr-synch: stubbed larger portions of the Synchronization API 2012-09-18 12:57:19 -04:00
Marc-André Moreau
faa4311232 libwinpr: add proper config.h inclusions 2012-08-14 17:20:53 -04:00
Marc-André Moreau
384af1d93b include: move winpr include directory inside winpr 2012-08-14 15:49:39 -04:00