7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.6 1997/09/24 23:37:26 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.7 1997/09/25 01:48:58 momjian Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
55
55
56
56
#define S_INIT_LOCK (lock ) mutex_init(lock)
57
57
58
- #define S_LOCK_FREE (lock ) ((*lock) == 0)
59
-
60
58
/* S_LOCK_FREE should return 1 if lock is free; 0 if lock is locked */
61
59
/* For Mach, we have to delve inside the entrails of `struct mutex'. Ick! */
62
60
#define S_LOCK_FREE (alock ) ((alock)->lock == 0)
@@ -135,8 +133,6 @@ static int tas(slock_t *lock);
135
133
136
134
#define S_INIT_LOCK (lock ) S_UNLOCK(lock)
137
135
138
- #define S_LOCK_FREE (lock ) ((*lock) == 0)
139
-
140
136
#endif /* i86pc_solaris || sparc_solaris */
141
137
142
138
/*
@@ -158,8 +154,6 @@ static int tas(slock_t *lock);
158
154
159
155
#define S_INIT_LOCK (lock ) S_UNLOCK(lock)
160
156
161
- #define S_LOCK_FREE (lock ) ((*lock) == 0)
162
-
163
157
#endif /* aix */
164
158
165
159
/*
@@ -211,8 +205,6 @@ static int tas(slock_t *lock);
211
205
212
206
#define S_INIT_LOCK (lock ) S_UNLOCK(lock)
213
207
214
- #define S_LOCK_FREE (lock ) ((*lock) == 0)
215
-
216
208
static int
217
209
tas_dummy ()
218
210
{
@@ -295,8 +287,6 @@ tas_dummy()
295
287
296
288
#define S_INIT_LOCK (addr ) (*(addr) = 0)
297
289
298
- #define S_LOCK_FREE (lock ) ((*lock) == 0)
299
-
300
290
#endif /* NEED_SPARC_TAS_ASM */
301
291
302
292
/*
@@ -318,8 +308,6 @@ tas_dummy()
318
308
319
309
#define S_INIT_LOCK (lock ) S_UNLOCK(lock)
320
310
321
- #define S_LOCK_FREE (lock ) ((*lock) == 0)
322
-
323
311
#endif /* NEED_I386_TAS_ASM */
324
312
325
313
@@ -351,8 +339,6 @@ tas_dummy()
351
339
352
340
#define S_INIT_LOCK (lock ) S_UNLOCK(lock)
353
341
354
- #define S_LOCK_FREE (lock ) ((*lock) == 0)
355
-
356
342
#endif /* defined(__alpha__) && defined(linux) */
357
343
358
344
#if defined(linux ) && defined(sparc )
@@ -372,8 +358,6 @@ tas_dummy()
372
358
373
359
#define S_INIT_LOCK (lock ) S_UNLOCK(lock)
374
360
375
- #define S_LOCK_FREE (lock ) ((*lock) == 0)
376
-
377
361
#endif /* defined(linux) && defined(sparc) */
378
362
379
363
#if defined(linux ) && defined(PPC )
@@ -407,10 +391,12 @@ success: \n\
407
391
408
392
#define S_INIT_LOCK (lock ) S_UNLOCK(lock)
409
393
410
- #define S_LOCK_FREE (lock ) ((*lock) == 0)
411
-
412
394
#endif /* defined(linux) && defined(PPC) */
413
395
396
+ #ifndef S_LOCK_FREE /* for those who have not already defined it */
397
+ #define S_LOCK_FREE (lock ) ((*lock) == 0)
398
+ #endif
399
+
414
400
#endif /* HAS_TEST_AND_SET */
415
401
416
402
#endif /* S_LOCK_H */
0 commit comments