refactor logger: add a write_wait method to avoid code duplication

This commit is contained in:
Beat Küng
2016-05-14 11:27:07 +02:00
committed by Lorenz Meier
parent 768e5ab66f
commit 63bd2cebf9
3 changed files with 26 additions and 30 deletions
+6
View File
@@ -80,6 +80,12 @@ private:
bool copy_if_updated_multi(orb_id_t topic, int multi_instance, int *handle, void *buffer, uint64_t *time_last_checked);
/**
* Write data to the logger. Waits if buffer is full until all data is written.
* Must be called with _writer.lock() held.
*/
bool write_wait(void *ptr, size_t size);
static constexpr size_t MAX_TOPICS_NUM = 128; /**< Maximum number of logged topics */
static constexpr unsigned MAX_NO_LOGFOLDER = 999; /**< Maximum number of log dirs */
static constexpr unsigned MAX_NO_LOGFILE = 999; /**< Maximum number of log files */