[BACK]Return to queue.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / external / mpl / bind / dist / lib / isc / include / isc

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/external/mpl/bind/dist/lib/isc/include/isc/Attic/queue.h between version 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2018/08/12 12:08:26 version 1.1.1.2, 2019/01/09 16:48:20
Line 23 
Line 23 
   
 #ifndef ISC_QUEUE_H  #ifndef ISC_QUEUE_H
 #define ISC_QUEUE_H 1  #define ISC_QUEUE_H 1
   
   #include <stdbool.h>
   
 #include <isc/assertions.h>  #include <isc/assertions.h>
 #include <isc/boolean.h>  
 #include <isc/mutex.h>  #include <isc/mutex.h>
   
 #ifdef ISC_QUEUE_CHECKINIT  #ifdef ISC_QUEUE_CHECKINIT
Line 49 
Line 51 
   
 #define ISC_QUEUE_INIT(queue, link) \  #define ISC_QUEUE_INIT(queue, link) \
         do { \          do { \
                 (void) isc_mutex_init(&(queue).taillock); \                  isc_mutex_init(&(queue).taillock); \
                 (void) isc_mutex_init(&(queue).headlock); \                  isc_mutex_init(&(queue).headlock); \
                 (queue).tail = (queue).head = NULL; \                  (queue).tail = (queue).head = NULL; \
         } while (0)          } while (0)
   
 #define ISC_QUEUE_EMPTY(queue) ISC_TF((queue).head == NULL)  #define ISC_QUEUE_EMPTY(queue) ((queue).head == NULL)
   
 #define ISC_QUEUE_DESTROY(queue) \  #define ISC_QUEUE_DESTROY(queue) \
         do { \          do { \
                 ISC_QLINK_INSIST(ISC_QUEUE_EMPTY(queue)); \                  ISC_QLINK_INSIST(ISC_QUEUE_EMPTY(queue)); \
                 (void) isc_mutex_destroy(&(queue).taillock); \                  isc_mutex_destroy(&(queue).taillock); \
                 (void) isc_mutex_destroy(&(queue).headlock); \                  isc_mutex_destroy(&(queue).headlock); \
         } while (0)          } while (0)
   
 /*  /*
Line 91 
Line 93 
  */   */
 #define ISC_QUEUE_PUSH(queue, elt, link) \  #define ISC_QUEUE_PUSH(queue, elt, link) \
         do { \          do { \
                 isc_boolean_t headlocked = ISC_FALSE; \                  bool headlocked = false; \
                 ISC_QLINK_INSIST(!ISC_QLINK_LINKED(elt, link)); \                  ISC_QLINK_INSIST(!ISC_QLINK_LINKED(elt, link)); \
                 if ((queue).head == NULL) { \                  if ((queue).head == NULL) { \
                         LOCK(&(queue).headlock); \                          LOCK(&(queue).headlock); \
                         headlocked = ISC_TRUE; \                          headlocked = true; \
                 } \                  } \
                 LOCK(&(queue).taillock); \                  LOCK(&(queue).taillock); \
                 if ((queue).tail == NULL && !headlocked) { \                  if ((queue).tail == NULL && !headlocked) { \
                         UNLOCK(&(queue).taillock); \                          UNLOCK(&(queue).taillock); \
                         LOCK(&(queue).headlock); \                          LOCK(&(queue).headlock); \
                         LOCK(&(queue).taillock); \                          LOCK(&(queue).taillock); \
                         headlocked = ISC_TRUE; \                          headlocked = true; \
                 } \                  } \
                 (elt)->link.prev = (queue).tail; \                  (elt)->link.prev = (queue).tail; \
                 (elt)->link.next = NULL; \                  (elt)->link.next = NULL; \

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2

CVSweb <webmaster@jp.NetBSD.org>