6 Commits

Author SHA1 Message Date
Azat Khuzhin
0ef87f5f0e test: move thread into realtime class even on EVENT__DISABLE_THREAD_SUPPORT
(cherry picked from commit ca2b72c546d80dfb4fa255b20ef4a829ed102a70)
2020-06-28 21:24:17 +03:00
Azat Khuzhin
5a400c1f28 test: fix compilation without thread support (EVENT__DISABLE_THREAD_SUPPORT=ON)
(cherry picked from commit d0adbc05654eca27384b6496cfd8a22ed4dfb4fb)
2020-06-28 21:22:40 +03:00
Azat Khuzhin
265cbe1077 test: fix compilation under win32 (rearrange thread_setup() code)
(cherry picked from commit 34d51e1bc9c650c4d012fe3024f7777c819ba969)
2020-06-28 21:22:37 +03:00
Azat Khuzhin
e85afbe3d5 Merge branch 'osx-clock'
Moves the thread into real-time scheduling class, as recommended in [1], it
fixes the separate test provided by @ygj6 [2] everywhere (github actions,
travis-ci, appveyor) under osx.

  [1]: https://developer.apple.com/library/archive/technotes/tn2169/_index.html
  [2]: dde1a6e4d0

Although even after this changes the following time-related tests failed
on travis-ci:
- no_events
- del_wait

But anyway I guess #940 can be closed, since this fixes the issue in common.

* osx-clock:
  test: Use THREAD_* wrappers in del_notify/del_wait
  test: move threads created with THREAD_START() to realtime scheduling class too
  test: put thread into real time scheduling class on osx for better latencies

Closes: #940
(cherry picked from commit a6f81aa45455c8afb69980f7026a0e706f4f9387)
2020-06-28 21:21:56 +03:00
Carlo Marcelo Arenas Belón
7d6c88dd11
test: make sure pthread is defined
avoid warnings with any modern C99 compiler due to implicit function
declaration for pthread_create, as shown by the following :

test/regress_dns.c:2226:2: warning: implicit declaration of function
      'pthread_create' is invalid in C99 [-Wimplicit-function-declaration]
        THREAD_START(thread[0], race_base_run, &rp);
        ^
test/regress_thread.h:35:2: note: expanded from macro 'THREAD_START'
        pthread_create(&(threadvar), NULL, fn, arg)
        ^
test/regress_dns.c:2226:2: warning: this function declaration is not a prototype
      [-Wstrict-prototypes]
test/regress_thread.h:35:2: note: expanded from macro 'THREAD_START'
        pthread_create(&(threadvar), NULL, fn, arg)
        ^

$ clang --version
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Closes: #686 (cherry-picked)
(cherry picked from commit 7af974eeaa7e5cf2f73e3176782c5a788a74f08e)
2019-02-02 15:17:58 +03:00
Nick Mathewson
8eedeabe50 Implement event_finalize() and related functions to avoid certain deadlocks 2013-04-26 12:18:07 -04:00