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

Commit85f7555

Browse files
committed
Small lock cleanup for prototype.
1 parent5fb82eb commit85f7555

File tree

2 files changed

+15
-25
lines changed

2 files changed

+15
-25
lines changed

‎src/include/storage/ipc.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: ipc.h,v 1.21 1997/09/18 14:20:54 momjian Exp $
9+
* $Id: ipc.h,v 1.22 1997/09/22 15:49:11 momjian Exp $
1010
*
1111
* NOTES
1212
* This file is very architecture-specific.This stuff should actually
@@ -26,20 +26,6 @@
2626

2727
#include<config.h>
2828

29-
#if defined(HAS_TEST_AND_SET)
30-
31-
#if (defined(alpha)&& !defined(linuxalpha))|| \
32-
defined(hpux)|| \
33-
defined(irix5)|| \
34-
defined(nextstep)
35-
externintS_LOCK_FREE(slock_t*lock);
36-
37-
#else
38-
#defineS_LOCK_FREE(lock)((*lock) == 0)
39-
#endif
40-
41-
#endif/* HAS_TEST_AND_SET */
42-
4329
#ifndefHAVE_UNION_SEMUN
4430
unionsemun
4531
{

‎src/include/storage/s_lock.h

Lines changed: 14 additions & 10 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.2 1997/09/2204:21:51 vadim Exp $
10+
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.3 1997/09/2215:49:14 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -301,11 +301,11 @@ tas_dummy()
301301

302302
#defineS_LOCK(lock)do \
303303
{ \
304-
slock_tres; \
304+
slock_t_res; \
305305
do \
306306
{ \
307-
__asm__("xchgb %0,%1": "=q"(res), "=m"(*lock):"0"(0x1)); \
308-
} while (res != 0); \
307+
__asm__("xchgb %0,%1": "=q"(_res), "=m"(*lock):"0"(0x1)); \
308+
} while (_res != 0); \
309309
} while (0)
310310

311311
#defineS_UNLOCK(lock)(*(lock) = 0)
@@ -319,7 +319,7 @@ tas_dummy()
319319

320320
#defineS_LOCK(lock)do \
321321
{ \
322-
slock_tres; \
322+
slock_t_res; \
323323
do \
324324
{ \
325325
__asm__(" ldq $0, %0 \n\
@@ -334,8 +334,8 @@ tas_dummy()
334334
jmp $31, end \n\
335335
stqc_fail: or $31, 1, $0 \n\
336336
already_set: bis $0, $0, %1 \n\
337-
end: nop ": "=m"(*lock), "=r"(res): :"0"); \
338-
} while (res != 0); \
337+
end: nop ": "=m"(*lock), "=r"(_res): :"0"); \
338+
} while (_res != 0); \
339339
} while (0)
340340

341341

@@ -349,13 +349,13 @@ tas_dummy()
349349

350350
#defineS_LOCK(lock)do \
351351
{ \
352-
slock_tres; \
352+
slock_t_res; \
353353
do \
354354
{ \
355355
__asm__("ldstub [%1], %0" \
356-
:"=&r"(res) \
356+
:"=&r"(_res) \
357357
:"r"(lock)); \
358-
} while (!res != 0); \
358+
} while (!_res != 0); \
359359
} while (0)
360360

361361
#defineS_UNLOCK(lock)(*(lock) = 0)
@@ -399,6 +399,10 @@ success:\n\
399399

400400
#endif/* defined(linux) && defined(PPC) */
401401

402+
#else/* HAS_TEST_AND_SET */
403+
404+
#defineS_LOCK_FREE(lock)((*lock) == 0)
405+
402406
#endif/* HAS_TEST_AND_SET */
403407

404408
#endif/* S_LOCK_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp