Browse code

- now GEN_LOCK_T_PREFERED is defined when is better/safe to use arrays of gen_lock_t instead of lock_set_t

Andrei Pelinescu-Onciul authored on 17/03/2003 18:43:52
Showing 2 changed files
... ...
@@ -57,7 +57,8 @@ Implements:
57 57
 	void lock_set_get(lock_set_t* s, int i);     - locks sem i from the set
58 58
 	void lock_set_release(lock_set_t* s, int i)  - unlocks sem i from the set
59 59
 
60
-WARNING: signals are not treated! (some locks are "awakened" by the signals)
60
+WARNING: - lock_set_init may fail for large number of sems (e.g. sysv). 
61
+         - signals are not treated! (some locks are "awakened" by the signals)
61 62
 */
62 63
 
63 64
 #ifndef _lock_ops_h
... ...
@@ -206,6 +207,7 @@ tryagain:
206 206
 /* lock sets */
207 207
 
208 208
 #if defined(FAST_LOCK) || defined(USE_PTHREAD_MUTEX) || defined(USE_POSIX_SEM)
209
+#define GEN_LOCK_T_PREFERED
209 210
 
210 211
 struct lock_set_t_ {
211 212
 	long size;
... ...
@@ -228,6 +230,7 @@ inline static lock_set_t* lock_set_init(lock_set_t* s)
228 228
 #define lock_set_release(set, i) lock_release(&set->locks[i])
229 229
 
230 230
 #elif defined(USE_SYSV_SEM)
231
+#undef GEN_LOCK_T_PREFERED
231 232
 
232 233
 struct lock_set_t_ {
233 234
 	int size;
... ...
@@ -57,7 +57,8 @@ Implements (in lock_ops.h & lock_alloc.h):
57 57
 	void lock_set_get(lock_set_t* s, int i);     - locks sem i from the set
58 58
 	void lock_set_release(lock_set_t* s, int i)  - unlocks sem i from the set
59 59
 
60
-WARNING: signals are not treated! (some locks are "awakened" by the signals)
60
+WARNING: - lock_set_init may fail for large number of sems (e.g. sysv). 
61
+         - signals are not treated! (some locks are "awakened" by the signals)
61 62
 */
62 63
 
63 64
 #ifndef _locking_h