Selaa lähdekoodia

-.minor updates

Andrei Pelinescu-Onciul 22 vuotta sitten
vanhempi
commit
7f5a5c30e0
1 muutettua tiedostoa jossa 11 lisäystä ja 0 poistoa
  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.