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

Commit609e32b

Browse files
committed
Add spinlock support for Itanium processor with Intel compiler.
Vikram Kalsi
1 parent164adc4 commit609e32b

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

‎src/include/storage/s_lock.h

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
6767
* Portions Copyright (c) 1994, Regents of the University of California
6868
*
69-
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.133 2004/12/31 22:03:42 pgsql Exp $
69+
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.134 2005/03/10 21:41:01 momjian Exp $
7070
*
7171
*-------------------------------------------------------------------------
7272
*/
@@ -168,14 +168,16 @@ spin_delay(void)
168168
#endif/* __i386__ || __x86_64__ */
169169

170170

171-
#if defined(__ia64__)|| defined(__ia64)/* __ia64 used by ICC compiler? */
171+
#if defined(__ia64__)|| defined(__ia64)
172172
/* Intel Itanium */
173173
#defineHAS_TEST_AND_SET
174174

175175
typedefunsignedintslock_t;
176176

177177
#defineTAS(lock) tas(lock)
178178

179+
#ifndef__INTEL_COMPILER
180+
179181
static __inline__int
180182
tas(volatileslock_t*lock)
181183
{
@@ -189,6 +191,19 @@ tas(volatile slock_t *lock)
189191
return (int)ret;
190192
}
191193

194+
#else
195+
196+
static __inline__int
197+
tas(volatileslock_t*lock)
198+
{
199+
intret;
200+
201+
ret=_InterlockedExchange(lock,1);/* this is a xchg asm macro */
202+
203+
returnret;
204+
}
205+
206+
#endif
192207
#endif/* __ia64__ || __ia64 */
193208

194209

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp