Commit Graph

304 Commits

Author SHA1 Message Date
akallabeth a3dae4ad46 Fix WINPR_EVENT and WINPR_TIMER structs.
Both structs must have the same base members so that the event
handle can be extracted at the same offset.
2019-10-01 21:03:03 +02:00
Bernhard Miklautz f867c90e4c
Merge pull request #5308 from akallabeth/fix_win32_overlinking
Fixed windows overlinking.
2019-05-03 12:01:51 +02:00
Armin Novak a16813d237 Fixed SleepEx return value and added log messages for unimplemented features. 2019-04-05 09:14:35 +02:00
Armin Novak c7b7d527f3 Fixed unused argument warnings for tests. 2019-04-05 09:14:35 +02:00
Armin Novak e605a10921 Fixed NULL argument warning. 2019-04-05 09:14:35 +02:00
Armin Novak 71924958bd Added event name to handle. 2019-04-05 09:14:35 +02:00
Armin Novak 55e9132fa4 Fixed NULL argument warning. 2019-04-05 09:14:35 +02:00
Armin Novak b5d9b6dba4 Improved timer implementation and error messages. 2019-04-05 09:14:35 +02:00
Armin Novak f8e5e8cd7d Improved error logging for wait functions. 2019-04-05 09:14:35 +02:00
Armin Novak 7b246121b4 Improved mutex and event functions
* Added name for debugging to handle.
* Implemented *Ex functions
2019-04-05 09:14:35 +02:00
Armin Novak 6e655189c3 Fixed sign-compare warnings 2019-04-05 09:14:34 +02:00
Armin Novak 8e0565b2bd Fixed windows overlinking. 2019-03-18 15:10:21 +01:00
Armin Novak 4e31cf929e Fixed ReleaseSemaphore, respect lReleaseCount
Signal the semapore lReleaseCount times.
2019-02-26 15:33:51 +01:00
Armin Novak 41d382569c Respect return value from SetEvent and abort creation. 2019-02-21 12:21:51 +01:00
Armin Novak f39ec7c453 Fixed sign-compare warning 2019-01-30 18:05:49 +01:00
Armin Novak 9033df501e Fixed compiler warnings for TRIO_CONST and limited data type. 2019-01-29 17:51:44 +01:00
Ilya Shipitsin be8f70998a remove not needed check
PVS analyzer: A part of conditional expression is always true: bWaitAll.
2018-11-15 01:51:44 +05:00
Armin Novak 86f08981ef Fixed warnings of uninitialized struct values. 2018-10-24 13:25:18 +02:00
Armin Novak e71a39f214 Fixed compiler warnings (unused) 2018-05-11 11:00:01 +02:00
akallabeth ba37f04e1b
Merge pull request #4616 from kevans91/timerfd-nonblock
Pass TFD_NONBLOCK to timerfd_create to avoid later fcntl
2018-05-03 10:56:04 +02:00
Kyle Evans 8073a7850e Pull in the libepoll-shim includes for libwinpr's synch/test
This allows FreeBSD to successfully build with BUILD_TESTING enabled. Currently,
only 3/184 tests fail:

	 13 - TestLibraryLoadLibrary (Failed)
	 14 - TestLibraryGetProcAddress (Failed)
	 15 - TestLibraryGetModuleFileName (Failed)

These failures are probably due to a lack of GetModuleFileNameA implementation
on FreeBSD.
2018-05-02 23:19:44 -05:00
Kyle Evans f1a7c3cc6a Pass TFD_NONBLOCK to timerfd_create to avoid later fcntl 2018-05-02 21:03:49 -05:00
Armin Novak 60bf33f79d Determine posix timer availability by function availability
To avoid having to whitelist every os starting to implement posix
timer API just detect if the functions are available.
2018-05-02 11:17:32 +02:00
Kyle Evans 45d8e2dfb2 Pull in libepoll-shim for the bits that require timerfd/epoll
libepoll-shim is our implementation of this API on top of kevent. It supplies
the same headers and a library, but we don't install it in any of the default
include search paths when it comes in through ports on an as-needed basis.

This set of changes is restricted to FREEBSD-compatible OS, which includes
DragonflyBSD and FreeBSD.
2018-05-01 23:42:25 -05:00
Armin Novak 9bd13c25c9 Added WaitableTimer implementation for mac OS. 2018-03-12 13:39:21 +01:00
Armin Novak 44eebbb6e0 Fixed compiler warnings. 2018-03-07 14:47:06 +01:00
Armin Novak 2517755d25 Fixed thread function return and parameters. 2018-03-07 14:36:55 +01:00
David Fort 917bc4b551 set some define consistency
This patch cleanup the defines to make then consistent.
2018-02-05 14:17:23 +01:00
Armin Novak 7305828122 Fix #4239: Various memory leaks
* Fixed all tests, now can be run with -DWITH_ADDRESS_SANITIZER=ON compiled.
* Enabled address sanitizer for nightly builds.
2017-12-12 11:40:48 +01:00
Armin Novak 90e1d39fec Fixed formatting and warnings. 2017-11-15 15:56:24 +01:00
Roman Kalashnikov 612e8b0710
Update semaphore.c 2017-10-28 11:59:23 +03:00
Roman Kalashnikov 67a97612e6
Fixed duplicated assigne 2017-10-28 01:46:06 +03:00
Norbert Federa 36b8f54c5e Fixed a few compiler warnings 2017-07-10 17:52:05 +02:00
Armin Novak b0289e3ed8 Fixed cast warnings. 2017-04-10 10:39:01 +02:00
Armin Novak bba910bd85 Fixed RPATH settings for OS X 2017-04-06 08:08:07 +02:00
Armin Novak 09d43a66f4 Fixed tests and dead store warnings. 2017-03-28 16:49:56 +02:00
Armin Novak b2c29158be Scanbuild warning, argument checks and leak fixes.
* Added Stream_GetRemainingCapacity to check remaining stream size
  before writes.
* Fixed shadow server memory leak.
* Fixed lots of scanbuild warnings
* Added missing argument checks in many functions
* Added missing static function declarations
2017-03-02 18:13:43 +01:00
Ilya Shipitsin 879f1c3944 removed redundant condition:
[winpr/libwinpr/synch/semaphore.c:131] -> [winpr/libwinpr/synch/semaphore.c:136]: (warning) Either the condition 'if(semaphore)' is redundant or there is possible null pointer dereference: semaphore.
[winpr/libwinpr/synch/semaphore.c:132] -> [winpr/libwinpr/synch/semaphore.c:136]: (warning) Either the condition 'if(semaphore)' is redundant or there is possible null pointer dereference: semaphore.
[winpr/libwinpr/synch/semaphore.c:133] -> [winpr/libwinpr/synch/semaphore.c:136]: (warning) Either the condition 'if(semaphore)' is redundant or there is possible null pointer dereference: semaphore.
[winpr/libwinpr/synch/semaphore.c:134] -> [winpr/libwinpr/synch/semaphore.c:136]: (warning) Either the condition 'if(semaphore)' is redundant or there is possible null pointer dereference: semaphore.
2017-01-28 12:36:08 +05:00
Norbert Federa f71b6b46e8 fix string format specifiers
- fixed invalid, missing or additional arguments
- removed all type casts from arguments
- added missing (void*) typecasts for %p arguments
- use inttypes defines where appropriate
2016-12-16 13:48:43 +01:00
Norbert Federa c6e6b44143 countless WLog/printf format specifier fixes 2016-11-25 17:06:25 +01:00
Bernhard Miklautz e54c504eaa winpr/wait: add missing parameters
Add the missing parameters introduced with PR #3381
2016-10-06 15:40:11 +02:00
Armin Novak 50c509eee2 Fixed barrier test. 2016-10-06 13:43:10 +02:00
Armin Novak 1454400236 Fixed windows defines for *LIST* 2016-10-06 13:43:10 +02:00
Armin Novak 64c5d78b3f Fixed clang warnings. 2016-10-06 13:43:09 +02:00
ed.velez ed697fa4ad fix_for_xcode8_clock_gettime 2016-09-22 15:42:43 -05:00
Norbert Federa 27c439675f winpr: fix win32 linking issues
Depending on the windows target version (_WIN32_WINNT), the used
SDK and the build configuration the linker will see multiple
libraries exporting the same symbols.
To prevent ugly hacks (e.g. modifying cmake's default system
libraries or fragile library linking order chains) we prefix
these functions with "winpr_" and create corresponding defines
to keep the current api names.
2016-06-16 11:47:33 +02:00
Norbert Federa f2c825bb76 winpr: fix some tests
TestNtCreateFile, TestPipeCreateNamedPipeOverlapped
- These tests are currently only expected to succeed on _WIN32
- Also reflect the reverse meaning of this fact in the return values

TestSynchWaitableTimer, TestSynchWaitableTimerAPC:
- These tests are currently expected to fail on __APPLE__
- Also reflect the reverse meaning of this fact in the return values

This logic makes sure that we don't forget to fix the tests if the
corresponding WinPR implementations are fixed.

TestLibrary:
- TestLibraryA and TestLibraryB must always get built as shared libraries
2016-06-07 17:20:56 +02:00
Norbert Federa f969e60a53 winpr/synch: fix barrier deadlock in release build
Let the compiler know that we're comparing a volatile value.
Otherwise the compiler might nuke the comparison operation
and produce code that will spin endlessly.
2016-06-07 13:06:50 +02:00
Norbert Federa a35a1e3d9b winpr/synch: fix InitializeWaitableTimer result
InitializeWaitableTimer must not reported success if the operating
sytem does not provide the required functionality.
2016-06-06 23:06:12 +02:00
Norbert Federa 131ffaa89b winpr/synch: improve barrier test
The SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY flag caused this test
to run extremely long if the system has very few processors.
Although this is expected (thread starvation) this will cause a
intolerably long execution time for automated tests.
Changed the number of threads to be calculated dyamically based
on the number of processors.
Also do proper cleanup to prevent memory leaks.
2016-06-06 15:41:05 +02:00