Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitebb3008

Browse files
committed
Fix for S_FREE_LOCK.
1 parentd77a506 commitebb3008

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

‎src/include/storage/s_lock.h

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.5 1997/09/22 18:14:25 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.6 1997/09/24 23:37:26 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -55,6 +55,8 @@
5555

5656
#defineS_INIT_LOCK(lock)mutex_init(lock)
5757

58+
#defineS_LOCK_FREE(lock)((*lock) == 0)
59+
5860
/* S_LOCK_FREE should return 1 if lock is free; 0 if lock is locked */
5961
/* For Mach, we have to delve inside the entrails of `struct mutex'. Ick! */
6062
#defineS_LOCK_FREE(alock)((alock)->lock == 0)
@@ -133,6 +135,8 @@ static inttas(slock_t *lock);
133135

134136
#defineS_INIT_LOCK(lock)S_UNLOCK(lock)
135137

138+
#defineS_LOCK_FREE(lock)((*lock) == 0)
139+
136140
#endif/* i86pc_solaris || sparc_solaris */
137141

138142
/*
@@ -154,6 +158,8 @@ static inttas(slock_t *lock);
154158

155159
#defineS_INIT_LOCK(lock)S_UNLOCK(lock)
156160

161+
#defineS_LOCK_FREE(lock)((*lock) == 0)
162+
157163
#endif/* aix */
158164

159165
/*
@@ -205,6 +211,8 @@ static inttas(slock_t *lock);
205211

206212
#defineS_INIT_LOCK(lock)S_UNLOCK(lock)
207213

214+
#defineS_LOCK_FREE(lock)((*lock) == 0)
215+
208216
staticint
209217
tas_dummy()
210218
{
@@ -287,6 +295,8 @@ tas_dummy()
287295

288296
#defineS_INIT_LOCK(addr)(*(addr) = 0)
289297

298+
#defineS_LOCK_FREE(lock)((*lock) == 0)
299+
290300
#endif/* NEED_SPARC_TAS_ASM */
291301

292302
/*
@@ -308,6 +318,8 @@ tas_dummy()
308318

309319
#defineS_INIT_LOCK(lock)S_UNLOCK(lock)
310320

321+
#defineS_LOCK_FREE(lock)((*lock) == 0)
322+
311323
#endif/* NEED_I386_TAS_ASM */
312324

313325

@@ -339,6 +351,8 @@ tas_dummy()
339351

340352
#defineS_INIT_LOCK(lock)S_UNLOCK(lock)
341353

354+
#defineS_LOCK_FREE(lock)((*lock) == 0)
355+
342356
#endif/* defined(__alpha__) && defined(linux) */
343357

344358
#if defined(linux)&& defined(sparc)
@@ -358,6 +372,8 @@ tas_dummy()
358372

359373
#defineS_INIT_LOCK(lock)S_UNLOCK(lock)
360374

375+
#defineS_LOCK_FREE(lock)((*lock) == 0)
376+
361377
#endif/* defined(linux) && defined(sparc) */
362378

363379
#if defined(linux)&& defined(PPC)
@@ -391,12 +407,10 @@ success:\n\
391407

392408
#defineS_INIT_LOCK(lock)S_UNLOCK(lock)
393409

394-
#endif/* defined(linux) && defined(PPC) */
395-
396-
#else/* HAS_TEST_AND_SET */
397-
398410
#defineS_LOCK_FREE(lock)((*lock) == 0)
399411

412+
#endif/* defined(linux) && defined(PPC) */
413+
400414
#endif/* HAS_TEST_AND_SET */
401415

402416
#endif/* S_LOCK_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp