}
}
+void metadata_hub_read_prolog(void) {
+ // always run this before reading an entry or a sequence of entries in the metadata_hub
+ // debug(1, "locking metadata hub for reading");
+ pthread_rwlock_rdlock(&metadata_hub_re_lock);
+}
+
+void metadata_hub_read_epilog(void) {
+ // always run this after reading an entry or a sequence of entries in the metadata_hub
+ // debug(1, "unlocking metadata hub for reading");
+ pthread_rwlock_unlock(&metadata_hub_re_lock);
+}
+
char *metadata_write_image_file(const char *buf, int len) {
// warning -- this removes all files from the directory apart from this one, if it exists
int speaker_volume; // this is the actual speaker volume, allowing for the main volume and the
// speaker volume control
- int previous_speaker_volume; // this is needed to prevent a loop
+ // int previous_speaker_volume; // this is needed to prevent a loop
metadata_watcher watchers[number_of_watchers]; // functions to call if the metadata is changed.
void *watchers_data[number_of_watchers]; // their individual data
// afterwards
void metadata_hub_modify_prolog(void);
void metadata_hub_modify_epilog(int modified); // set to true if modifications occured, 0 otherwise
+
+// these are for safe reading
+void metadata_hub_read_prolog(void);
+void metadata_hub_read_epilog(void);