From 10dc09fcd41122d5d67d46d53f79309fefebf9a0 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 14 Mar 2022 14:00:51 -0600 Subject: [PATCH] temporal: extend TempoMap thread local ptr API a little This allows checking to see if the map has changed compared with the thread's current local pointer. --- libs/temporal/temporal/tempo.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/temporal/temporal/tempo.h b/libs/temporal/temporal/tempo.h index c62391bae8..39a7de3b08 100644 --- a/libs/temporal/temporal/tempo.h +++ b/libs/temporal/temporal/tempo.h @@ -668,6 +668,8 @@ class /*LIBTEMPORAL_API*/ TempoMap : public PBD::StatefulDestructible LIBTEMPORAL_API static void update_thread_tempo_map() { _tempo_map_p = _map_mgr.reader(); } LIBTEMPORAL_API static SharedPtr use() { assert (_tempo_map_p); return _tempo_map_p; } LIBTEMPORAL_API static SharedPtr fetch() { update_thread_tempo_map(); return use(); } + LIBTEMPORAL_API static SharedPtr read() { return _map_mgr.reader(); } + LIBTEMPORAL_API static void set (SharedPtr new_map) { _tempo_map_p = new_map; /* new_map must have been fetched with read() */ } LIBTEMPORAL_API static SharedPtr write_copy(); LIBTEMPORAL_API static void fetch_writable() { _tempo_map_p = write_copy(); }