ovs-atomic: Add atomic_destroy() and use everywhere it is needed.
[sliver-openvswitch.git] / lib / ovs-atomic-pthreads.h
index 840c7a6..dc8f498 100644 (file)
@@ -85,6 +85,9 @@ typedef enum {
     ((OBJECT)->value = (VALUE),                         \
      pthread_mutex_init(&(OBJECT)->mutex, NULL),        \
      (void) 0)
+#define atomic_destroy(OBJECT)                  \
+    (pthread_mutex_destroy(&(OBJECT)->mutex),   \
+     (void) 0)
 
 static inline void
 atomic_thread_fence(memory_order order OVS_UNUSED)