13
0
Commit Graph

14 Commits

Author SHA1 Message Date
0d9656ef82 use new macros to cleanup #ifndef NDEBUG as much as possible (libs edition) 2022-06-22 13:31:08 -06:00
4599b07217 fix optimized unused variable warning 2022-06-22 13:31:08 -06:00
24bbf403b9
Replace Glib::Threads with PBD::Thread (1/2) 2022-03-01 01:33:49 +01:00
c9035efb25 timeline types for libs/waveview 2021-08-13 12:51:29 -06:00
a6fc82537e
Fix assert in Waveview cache size
previous condition made no sense. effectively assert(bytes > 0).
2021-05-23 21:41:45 +02:00
19c9622a30 NOOP: comment fix, there is no deadlock! 2021-05-11 08:35:14 -06:00
99022a6157 waveview: add some extensive notes about threading design 2021-05-11 07:57:31 -06:00
1a9df476c2 waveview: now that _quit is protected by a mutex, it doesn't need to be atomic
No reason to have two memory fences when we only need one
2021-05-11 07:57:31 -06:00
166ac63924 waveview: redesign thread exit strategy
The previous design had a race condition. When WaveViewThreads::stop_threads() was called, it would
first acquire the mutex, then set _quit, then call condition.broadcast(). But worker threads would
check _quit without holding the mutex. It was therefore for a thread to be delayed in its
own lock acquisition by the ::stop_threads() caller, then end up back in cond.wait() AFTER
the cond.broadcast() was done. Such a thread would sleep forever and never wake up.

This new design removes WaveViewDrawRequestQueue, which was a clean encapsulation of the
queueing aspects of WaveViewThreads, but unfortunately made correct mutex acquisition
and condition signalling/waiting needlessly complex. THe mutex, condition variable
and actual queue were moved into WaveViewThreads, and all worker threads execute a method
of the class which gives the appropriate code easy access to the mutex and condition var,
which must always be used together.
2021-05-10 21:41:26 -06:00
cc7b8b1bc5
gcc-11 compat, volatile atomic variables (1/2)
"While 'atomic' has a volatile qualifier, this is a historical
artifact and the pointer passed to it should not be volatile."

Furthermore "It is very important that all accesses to a
particular integer or pointer be performed using only this API"
(from https://developer.gnome.org/glib/2.68/glib-Atomic-Operations.html)

Hence initialization of atomic variables is changed to also use
this API, instead of directly initializing the value.

This also fixes a few cases where atomic variables were
accessed directly.

see also libs/pbd/pbd/g_atomic_compat.h
2021-03-22 15:30:07 +01:00
c365c6cdb2
Set thread-names (libs) 2020-03-29 14:56:22 +02:00
e2bb59a3e3 limit waveview render threads to 8 2019-10-28 17:24:21 -06:00
cec5ce8f45
Update canvas/UI lib GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
beb73edf55 Purify libcanvas, remove libardour dependency
A canvas is just a canvas. Move WaveView into its own library.
2017-07-17 21:06:04 +02:00