summaryrefslogtreecommitdiffstats
path: root/src/H5FDvfd_swmr_private.h
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-12-10 16:52:58 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2019-12-10 16:52:58 (GMT)
commitfed174988dc6eb9125adcf33b946be042d68cf1c (patch)
tree6a44d35cb945a2d1eda92f7598b26f725213eaf4 /src/H5FDvfd_swmr_private.h
parent38902de4932939e701f01219f4bff6d70b3953a7 (diff)
downloadhdf5-fed174988dc6eb9125adcf33b946be042d68cf1c.zip
hdf5-fed174988dc6eb9125adcf33b946be042d68cf1c.tar.gz
hdf5-fed174988dc6eb9125adcf33b946be042d68cf1c.tar.bz2
Shorten the type name `H5F_vfd_swmr_eot_queue_entry_t` to `eot_queue_entry_t`:
people have to read and type this stuff! Use TAILQ_* macros instead of an unnecessary custom implementation of doubly-linked lists.
Diffstat (limited to 'src/H5FDvfd_swmr_private.h')
-rw-r--r--src/H5FDvfd_swmr_private.h32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/H5FDvfd_swmr_private.h b/src/H5FDvfd_swmr_private.h
index c12239c..5351b07 100644
--- a/src/H5FDvfd_swmr_private.h
+++ b/src/H5FDvfd_swmr_private.h
@@ -12,13 +12,15 @@
#ifndef _H5FDvfd_swmr_private_H
#define _H5FDvfd_swmr_private_H
+#include "bsdqueue.h" /* for TAILQ_* */
+
/* Forward declaration */
struct H5F_t;
struct H5F_shared_t;
struct H5FD_vfd_swmr_idx_entry_t;
/*
- * struct H5F_vfd_eot_queue_entry_t
+ * struct eot_queue_entry_t
*
* This is the structure for an entry on the end-of-tick queue (EOT queue) of files
* opened in either VFD SWMR write or VFD SWMR read mode. This queue is maintained
@@ -27,7 +29,7 @@ struct H5FD_vfd_swmr_idx_entry_t;
* of tick has arrived for the specified file, and to initiate end of tick processing
* if it has.
*
- * The fields of H5F_vfd_eot_queue_entry_t are discussed below:
+ * The fields of eot_queue_entry_t are discussed below:
*
* vfd_swmr_file: Pointer to the instance of H5F_file_t containing the shared
* fields of the associated file that has been opened in VFD SWMR mode
@@ -41,31 +43,27 @@ struct H5FD_vfd_swmr_idx_entry_t;
*
* end_of_tick: Expiration time of the current tick of the target file.
*
- * next: Pointer to the next element in the end of tick queue, or NULL if there
- * is no next entry. Note that if next is not NULL, next->end_of_tick
- * must be greater than or equal to end_of_tick.
- *
- * prev: Pointer to the previous element in the end of tick queue, or NULL if
- * there is no previous entry. Note that if prev is not NULL,
- * prev->end_of_tick must be less than or equal to end_of_tick.
- *
+ * link: Forward and backward linkage between the next element and the previous
+ * element (or the queue head). Note that if there is a following entry,
+ * `next`, then `next->end_of_tick` must be greater than or equal to
+ * `end_of_tick`.
*/
-typedef struct H5F_vfd_swmr_eot_queue_entry_t {
+typedef struct eot_queue_entry {
hbool_t vfd_swmr_writer;
uint64_t tick_num;
struct timespec end_of_tick;
struct H5F_t *vfd_swmr_file; /* NOTE: for the time being use H5F_t instead H5F_file_t */
- struct H5F_vfd_swmr_eot_queue_entry_t *next;
- struct H5F_vfd_swmr_eot_queue_entry_t *prev;
-} H5F_vfd_swmr_eot_queue_entry_t;
+ TAILQ_ENTRY(eot_queue_entry) link;
+} eot_queue_entry_t;
extern unsigned int vfd_swmr_api_entries_g;
extern hbool_t vfd_swmr_writer_g;
extern struct timespec end_of_tick_g;
-/* The head and tail pointers of the EOT queue */
-extern H5F_vfd_swmr_eot_queue_entry_t *vfd_swmr_eot_queue_head_g;
-extern H5F_vfd_swmr_eot_queue_entry_t *vfd_swmr_eot_queue_tail_g;
+/* The head of the EOT queue */
+typedef TAILQ_HEAD(eot_queue, eot_queue_entry) eot_queue_t;
+
+extern eot_queue_t eot_queue_g;
/***************************************/
/* Library-private Function Prototypes */