13
0
Commit Graph

1516 Commits

Author SHA1 Message Date
25d1209bb4
Only dump SessionEvent pool in debug builds
This ensures that the user will see a "POOL OUT OF MEMORY" message.
In rare case dumping the pool can segfault when printing the Event,
The pool is zero initialized and only ever contains events, so
in theory it is safe to print them..
2022-07-07 22:34:11 +02:00
9e11ef4f39
MixerScene: handle edge-case with midi-cc/bender controllables 2022-07-07 16:06:08 +02:00
effc209070
Place Pool in PBD namespace
A public class named "Pool" in the global namespace just
calls for symbol name conflicts.
2022-07-07 05:21:54 +02:00
8418e7c954
NO-OP: clang-format 2022-07-07 05:21:49 +02:00
1694c71cd5
Implement memory-pool debug-dump
This will allow to trace "POOL OUT OF MEMORY" and see
which events fill up the event/memory pool.
2022-07-07 05:21:31 +02:00
0d70be3a05 miscellaneous fixes for warnings from -Wconversion 2022-07-04 22:01:48 -06:00
9ab32d7cb4
Fix builds on platforms without execinfo (amend cd4549aff7) 2022-06-23 01:59:58 +02:00
0004ca2c41 add useful DEBUG_RESULT and DEBUG_RESULT_CAST to pbd/debug.h 2022-06-22 13:31:08 -06:00
d917d7b351 fix actual x_assert macro definition 2022-06-22 13:31:08 -06:00
df641765ec add new header for x_assert() macro 2022-06-22 13:31:08 -06:00
24f1a65d5f use C style cast in C code, rather than C++ constructor 2022-06-22 13:31:08 -06:00
48a109e8c8 fix snprintf buffer size warning 2022-06-22 13:31:08 -06:00
cd4549aff7 fix signed/unsigned warning 2022-06-21 17:31:50 -06:00
dc4235efbe fix left-shift of negative value warning 2022-06-21 17:31:17 -06:00
32b41037b5 libpbd: do not use debug transmitter inside BaseUI::signal_new_request() to avoid recursion 2022-06-13 13:43:31 -06:00
20997dfa78 add new exception-safe RAII object, that increments/decrements its argument 2022-06-13 10:51:04 -06:00
95aa39d1c4
Update call_slot() API, inform caller if slot cannot be queued
It can happen that ::get_request() returns NULL if the
EventPool is full. In that case the slot is never called.

In this case the caller can now take action.
2022-06-09 01:46:27 +02:00
87ee609339
Amend previous commit, fix debug print format 2022-06-03 05:32:19 +02:00
fd5d290217
Fix mach thread time constraints on M1
or any system where timebase is not 1 tick per ns.
2022-06-03 05:27:42 +02:00
c2cff575b7
Add debug info to track down M1 time-constraint issue 2022-06-03 03:52:43 +02:00
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
12e5042ece libpbd: add muldiv() to compute v * (n/d) without overflow 2022-05-27 12:47:44 -06:00
e1f5fb0206 libpbd: change GlibEventLoopCallback to use C API not C++
We discovered in the past that the C++ API for GSource/Glib::Source has some fatal and unfixable flaws. Copy similar
code and just use the C API for GSource instead
2022-05-19 22:24:43 -06:00
a811583380
Add API to query registered controllers 2022-05-19 20:08:08 +02:00
4c1506e50e add copyright notices 2022-05-16 15:41:56 -06:00
968533cc23 (re)add mechanism for a callback in any glib event loop executed before the loop "executes"
This is based on code from earlier commits that were later reversed, but we need some mechanism
to ensure that threads have a thread local tempo map ptr set. The big difference is that this
time we do not implement this for all instances of an AbstractUI - implementation is left to
each thread/event loop
2022-05-16 15:24:52 -06:00
itmuckel
9178ca635a
Remove unused imports and modernize stateful.cc 2022-05-13 23:07:49 +02:00
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
f849f3ce2c
Use futex semaphores on Linux only 2022-05-12 00:56:33 +02:00
5ca76789c5
Allow to query capacity of MPMC queue
This is in preparation to grow the queue as needed.
2022-05-12 00:40:31 +02:00
34678c094a
Implement Futex semaphore 2022-05-11 23:55:41 +02:00
f7e917c123
Potential fix for M1 x-thread events
On M1, the cross-thread channel sets G_IO_PRI in addition to G_IO_IN
this breaks various assumptions in receivers, which test for ~G_IO_IN
as error condition.
2022-05-02 00:02:33 +02:00
3d860b9665 libpbd: do not use DEBUG transmitter from inside AbstractUI<T> request methods
This will lead to recursion, since delivering the debug msg goes through a request method.

Discovered by running with -D all
2022-04-26 22:04:08 -06:00
9ce91e2952
NO-OP: clang-format 2022-04-23 23:12:13 +02:00
c1d6c0690e
Fix poll() edge case on macOS, clean up logic
Return from poll_for_request() when CrossThreadChannel is
closed/destroyed. -- see also f4166fb61d

This also cleans up poll API usage, and check for nonnegative
return value is added.
2022-04-23 23:12:10 +02:00
defc902571
Allow to use Destructible as virtual base class
This is in preparation for a pure-virtual base class for
PluginInsert to expose `DropReferences` in the virtual base.

```
class PlugInsertBase : virtual public PBD::Destructible
class PluginInsert : public Processor, public PlugInsertBase
class Processor : public SessionObject
class SessionObject : public PBD::StatefulDestructible
```
2022-04-14 16:35:02 +02:00
luz paz
fb55878375
Fix source typos (heirarchy->hierarchy) 2022-04-08 21:38:00 +02:00
7bf89ce109 Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
e15fb0dc38
Fix unset of LIBRARY_PATH environment variable
see also 82d491cb80
2022-04-01 20:50:28 +02:00
82d491cb80
Allow to unset LD_LIBRARY_PATH on exec
This is useful when using distro-packaged video-tools
(e.g. on Linux/ARM), or when running post-export commands.
2022-04-01 18:19:55 +02:00
abbf1ca698
Allow to get exit status from child processes 2022-03-11 18:18:06 +01:00
84c51a1411
Fix BaseUI x-thread signal vs thread-start race
Control surfaces c'tor usually subscribe to signals e.g.
PortConnectedOrDisconnected. This happens after the parent BaseUI
is created, but before set_active() -> BaseUI::run() is called.

At this point in time there is no run_loop thread.

There are two options to handle AbstractUI::call_slot():

 A. Queue the event in the event-loop, using the thread-local
    request buffer of the caller. Then hope the BaseUI
    thread is started, and calls ::handle_ui_requests() before
    the memory pool runs out of space.

 B. Handle the event in the calling thread. -- This may not be
    rt-safe and may call functions with locks held by the caller.
    It will however not accumulate events.

This takes approach (B). If _run_loop_thread is NULL, directly
handle the signal.

In the past, prior to 50abcc74b5, approach (A) was taken.
NULL never matched Glib::Threads::Thread::self().

This also reverts a prior attempt (e417495505) to address this issue.
2022-03-02 21:19:12 +01:00
e417495505
Fix possible race (BaseUI creation vs x-thread signal-emission)
When a BaseUI is being created, signals can arrive before the
_run_loop_thread is running, which can trigger an assert in
BaseUI::caller_is_self().
2022-03-01 17:19:20 +01:00
50abcc74b5
Replace Glib::Threads with PBD::Thread (2/2) 2022-03-01 01:34:35 +01:00
e515e73db6
Implement a replacement for Glib::Threads::Thread
This is mainly because Glib::Threads (g_system_thread_new)
uses pthread on Un*x, but on Windows relies on GThreadWin32
(HANDLE)_beginthreadex

This later causes issues e.g. in BaseUI::run()

```
unhandled exception (type Glib::Error) in signal handler:
domain: g_thread_error
code  : 0
what  : Error setting new thread priority: The parameter is incorrect.
```
2022-03-01 01:33:08 +01:00
baf2323798 add PBD::PropertyChange::dump (std::ostream&) to make it easier to see what changed 2022-02-09 10:08:01 -07:00
c17fbd5abc
Fix poor_mans_glob, ~' for $HOME' is only valid at the start of a path 2022-02-01 15:47:54 +01:00
f7b826841b
Log Thread-name in stacktrace 2022-01-26 00:17:49 +01:00
Mads Kiilerich
8bb91099c5 wscript: drop configure statements already present in the top level wscript
Avoid repeated pointless configure messages like:
Checking for 'g++' (C++ compiler!)                   : /usr/lib64/ccache/g++
Checking for 'gcc' (C compiler)                      : /usr/lib64/ccache/gcc
2022-01-22 22:19:03 +01:00
beb0a96f42
API to directly retrieve XML child content 2022-01-13 00:09:55 +01:00