From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Mon, 11 Sep 2023 19:03:16 +0000 (+0100) Subject: Comment update X-Git-Tag: 4.3~1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c76ef97bee9a297a5e7fa9ba55a40b34c5ea7c03;p=thirdparty%2Fshairport-sync.git Comment update --- diff --git a/nqptp-shm-structures.h b/nqptp-shm-structures.h index 09f3b600..85b2c9dd 100644 --- a/nqptp-shm-structures.h +++ b/nqptp-shm-structures.h @@ -1,6 +1,6 @@ /* * This file is part of the nqptp distribution (https://github.com/mikebrady/nqptp). - * Copyright (c) 2021--2022 Mike Brady. + * Copyright (c) 2021--2023 Mike Brady. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -62,10 +62,13 @@ typedef struct { uint64_t master_clock_start_time; // this is when the master clock became master } shm_structure_set; -// The secondary record must be written strictly after all writes to the main record are -// complete. -// This is ensured using the __sync_synchronize() construct. +// The actual interface comprises a shared memory region of type struct shm_structure. +// This comprises two records of type shm_structure_set. +// The secondary record is written strictly after all writes to the main record are +// complete. This is ensured using the __sync_synchronize() construct. // The reader should ensure that both copies match for a read to be valid. +// For safety, the secondary record should be read strictly after the first. + struct shm_structure { uint16_t version; // check this is equal to NQPTP_SHM_STRUCTURES_VERSION shm_structure_set main;