This commit adds guide about using thread safety types and annotations
to CodingStyle file.

Signed-off-by: Alex Wang <[email protected]>
---
 CodingStyle |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/CodingStyle b/CodingStyle
index 55b37a1..cfbdcfb 100644
--- a/CodingStyle
+++ b/CodingStyle
@@ -298,6 +298,17 @@ the name of each enum.  For example:
     };
 
 
+THREAD SAFETY ANNOTATIONS
+
+  Use corresponding annotation macros for plain and read/write mutex.
+For example:
+
+    void function_require_plain_mutex() OVS_REQUIRES(mutex);
+    void function_require_rwlock() OVS_REQ_RDLOCK(rwlock)
+
+  Don't ampersand the arguments passed to annotation macros.
+
+
 SOURCE FILES
 
   Each source file should state its license in a comment at the very
@@ -400,6 +411,9 @@ are convinced there is a size or speed benefit.
   Pointer declarators bind to the variable name, not the type name.
 Write "int *x", not "int* x" and definitely not "int * x".
 
+  Use ovs_mutex for plain mutex, and ovs_rwlock for read/write
+  mutex.
+
 
 EXPRESSIONS
 
-- 
1.7.9.5

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to