浏览代码

-.minor updates

Andrei Pelinescu-Onciul 22 年之前
父节点
当前提交
7f5a5c30e0
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      doc/locking.txt

+ 11 - 0
doc/locking.txt

@@ -123,6 +123,12 @@ if (lock_set_init(lock_set)==0){
    goto error;
 }
 
+or
+ if ((lock_set=lock_set_alloc(100))==0) || (lock_set_init(lock_set)==0)){
+   if (lock_set) lock_set_dealloc(lock_set);
+   goto error;
+ }
+
 
 Destroying & deallocating:
 --------------------------
@@ -145,3 +151,8 @@ lock_set_get(lock_set, 2);
 lock_set_release(lock_set, 2);
 
 
+When to use lock_set_t & when to use gen_lock_t
+-----------------------------------------------
+If you use lots of semaphores and GEN_LOCK_T_PREFERED is undefined then use
+ lock_set_t. If GEN_LOCK_T_PREFERED is defined you can safely use gen_lock_t 
+ arrays instead.