13
0

NO-OP: cleanup public API, re-indent source

This commit is contained in:
Robin Gareus 2022-05-03 23:58:50 +02:00
parent 96c138c985
commit 28231d6365
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 138 additions and 138 deletions

View File

@ -28,16 +28,16 @@
#include <glibmm/threads.h>
#include "pbd/crossthread.h"
#include "pbd/ringbuffer.h"
#include "pbd/pool.h"
#include "pbd/g_atomic_compat.h"
#include "pbd/pool.h"
#include "pbd/ringbuffer.h"
#include "ardour/libardour_visibility.h"
#include "ardour/types.h"
#include "ardour/session_handle.h"
#include "ardour/types.h"
namespace ARDOUR {
namespace ARDOUR
{
/**
* One of the Butler's functions is to clean up (ie delete) unused CrossThreadPools.
* When a thread with a CrossThreadPool terminates, its CTP is added to pool_trash.
@ -62,13 +62,22 @@ class LIBARDOUR_API Butler : public SessionHandleRef
void map_parameters ();
samplecnt_t audio_capture_buffer_size() const { return _audio_capture_buffer_size; }
samplecnt_t audio_playback_buffer_size() const { return _audio_playback_buffer_size; }
uint32_t midi_buffer_size() const { return _midi_buffer_size; }
samplecnt_t audio_capture_buffer_size () const
{
return _audio_capture_buffer_size;
}
samplecnt_t audio_playback_buffer_size () const
{
return _audio_playback_buffer_size;
}
uint32_t midi_buffer_size () const
{
return _midi_buffer_size;
}
static void* _thread_work(void *arg);
void* thread_work();
mutable GATOMIC_QUAL gint should_do_transport_work;
private:
struct Request {
enum Type {
Run,
@ -77,33 +86,29 @@ class LIBARDOUR_API Butler : public SessionHandleRef
};
};
static void* _thread_work (void* arg);
void* thread_work ();
void empty_pool_trash ();
void config_changed (std::string);
bool flush_tracks_to_disk_normal (boost::shared_ptr<RouteList>, uint32_t& errors);
void queue_request (Request::Type r);
pthread_t thread;
bool have_thread;
Glib::Threads::Mutex request_lock;
Glib::Threads::Cond paused;
bool should_run;
mutable GATOMIC_QUAL gint should_do_transport_work;
samplecnt_t _audio_capture_buffer_size;
samplecnt_t _audio_playback_buffer_size;
uint32_t _midi_buffer_size;
PBD::RingBuffer<CrossThreadPool*> pool_trash;
private:
void empty_pool_trash ();
void config_changed (std::string);
bool flush_tracks_to_disk_normal (boost::shared_ptr<RouteList>, uint32_t& errors);
/**
* Add request to butler thread request queue
*/
void queue_request (Request::Type r);
CrossThreadChannel _xthread;
};
} // namespace ARDOUR

View File

@ -34,6 +34,7 @@
#include "temporal/superclock.h"
#include "temporal/tempo.h"
#include "ardour/auditioner.h"
#include "ardour/butler.h"
#include "ardour/debug.h"
#include "ardour/disk_io.h"
@ -41,13 +42,13 @@
#include "ardour/io.h"
#include "ardour/session.h"
#include "ardour/track.h"
#include "ardour/auditioner.h"
#include "pbd/i18n.h"
using namespace PBD;
namespace ARDOUR {
namespace ARDOUR
{
Butler::Butler (Session& s)
: SessionHandleRef (s)
@ -173,7 +174,6 @@ void *
Butler::thread_work ()
{
uint32_t err = 0;
bool disk_work_outstanding = false;
RouteList::iterator i;
@ -188,7 +188,6 @@ Butler::thread_work ()
if (_xthread.receive (msg, true) >= 0) {
Request::Type req = (Request::Type)msg;
switch (req) {
case Request::Run:
DEBUG_TRACE (DEBUG::Butler, string_compose ("%1: butler asked to run @ %2\n", DEBUG_THREAD_SELF, g_get_monotonic_time ()));
should_run = true;
@ -253,7 +252,6 @@ Butler::thread_work ()
DEBUG_TRACE (DEBUG::Butler, string_compose ("butler starts refill loop, twr = %1\n", transport_work_requested ()));
for (i = rl_with_auditioner.begin (); !transport_work_requested () && should_run && i != rl_with_auditioner.end (); ++i) {
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
if (!tr) {
@ -283,7 +281,6 @@ Butler::thread_work ()
std::cerr << string_compose (_("Butler read ahead failure on dstream %1"), (*i)->name ()) << std::endl;
break;
}
}
if (i != rl_with_auditioner.begin () && i != rl_with_auditioner.end ()) {
@ -341,7 +338,6 @@ Butler::flush_tracks_to_disk_normal (boost::shared_ptr<RouteList> rl, uint32_t&
bool disk_work_outstanding = false;
for (RouteList::iterator i = rl->begin (); !transport_work_requested () && should_run && i != rl->end (); ++i) {
// cerr << "write behind for " << (*i)->name () << endl;
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
@ -475,5 +471,4 @@ Butler::drop_references ()
SessionEvent::pool->set_trash (0);
}
} // namespace ARDOUR