[rtems commit] ringbuf: Fix ISR lock initialization/destruction

Sebastian Huber sebh at rtems.org
Tue Apr 1 12:03:56 UTC 2014


Module:    rtems
Branch:    master
Commit:    25a978354c8dca740d956e17e3bada1ed0f62612
Changeset: http://git.rtems.org/rtems/commit/?id=25a978354c8dca740d956e17e3bada1ed0f62612

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Apr  1 08:31:16 2014 +0200

ringbuf: Fix ISR lock initialization/destruction

---

 cpukit/libcsupport/include/ringbuf.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/cpukit/libcsupport/include/ringbuf.h b/cpukit/libcsupport/include/ringbuf.h
index 05bcceb..c16a79d 100644
--- a/cpukit/libcsupport/include/ringbuf.h
+++ b/cpukit/libcsupport/include/ringbuf.h
@@ -26,6 +26,12 @@ typedef struct {
 #define Ring_buffer_Initialize( _buffer ) \
   do { \
     (_buffer)->head = (_buffer)->tail = 0; \
+    rtems_interrupt_lock_initialize(&(_buffer)->lock, "ring buffer"); \
+  } while ( 0 )
+
+#define Ring_buffer_Destory( _buffer ) \
+  do { \
+    rtems_interrupt_lock_destroy(&(_buffer)->lock); \
   } while ( 0 )
 
 #define Ring_buffer_Is_empty( _buffer ) \




More information about the vc mailing list