Commit Graph

17 Commits

Author SHA1 Message Date
Robin Gareus 2ae670055d
Explicitly initialize futex word
This is mainly to silence valgrind warnings, the actual value
is irrelevant here.
2022-11-13 03:01:50 +01:00
Robin Gareus 60db5a827f
Use SYS_futex instead of __NR_futex
Use the C library definition for portability; also test
for support instead of unconditionally enabling it.
2022-05-30 21:56:49 +02:00
Robin Gareus 40fa6e2023
Improve PBD::Semaphore performance
Skip syscall if no threads are waiting and decouple atomic
value from futex address so that FUTEX_WAIT does not fail.
2022-05-12 05:27:27 +02:00
Robin Gareus 34678c094a
Implement Futex semaphore 2022-05-11 23:55:41 +02:00
Todd Naugle 1a1e67f595 Use Posix style return values for sem wait when on windows.
0 on success, -1 on error
2021-05-27 15:17:15 -05:00
Todd Naugle be6d0fa95c Do not use named semaphores on Windows since they are system wide
https://docs.microsoft.com/en-us/dotnet/standard/threading/semaphore-and-semaphoreslim#named-semaphores

Running multiple instances of Ardour or Ardour/Mixbus would fail in very
odd ways since they would signal each other. Unnamed sems are
correct for this use case.
2021-05-27 15:13:40 -05:00
Robin Gareus 0301c47f6b
Update core library GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
Robin Gareus 9c0ba3b3d5 Add mechanism to reset/lock semaphores 2017-04-22 23:06:22 +02:00
Robin Gareus c93f0b77bf rename ProcessSemaphore to Semaphore (libs) 2015-12-02 20:18:48 +01:00
Robin Gareus 14d6470ad3 prefer pthread-semaphores (posix API) with mingw
Hopefully this resolves glitches on hyperthreading machines.
Apart from using unnamed Semaphores, pthread-w32 includes additional locks
(guess: mem-barriers), a fallback implementation and windows-specific
tricks that I'd rather not want to know about :)
2015-12-02 13:59:48 +01:00
Robin Gareus 22b07e0233 NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
Paul Davis 3020b224fa Merge windows+cc branch into cairocanvas branch. Not finished, need to now merge windows branch to get changes from there 2014-01-10 16:07:57 -05:00
Paul Davis 0cca272431 try to fix various warnings from gcc when optimization flags are enabled 2013-11-04 21:32:41 -05:00
John Emmas 350ed31655 Remaining changes needed for building libpdb on Windows (except for adding the extra JE source modules) 2013-07-17 08:08:46 +01:00
Paul Davis e70db68fac Add implementation for ProcessSemaphore on windows 2013-07-11 12:46:05 -04:00
Paul Davis 3d0a53a1ad fix linux side of semaphore abstraction
git-svn-id: svn://localhost/ardour2/branches/3.0@8050 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-11-16 20:01:01 +00:00
Paul Davis 8e2f6b9e0f handle OS X's lack of unnamed semaphores, phase 1
git-svn-id: svn://localhost/ardour2/branches/3.0@8049 d708f5d6-7413-0410-9779-e7cbd77b26cf
2010-11-16 19:47:38 +00:00