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#define HAS_TEST_AND_SET
174174
175175typedef unsignedint slock_t ;
176176
177177#define TAS (lock ) tas(lock)
178178
179+ #ifndef __INTEL_COMPILER
180+
179181static __inline__int
180182tas (volatile slock_t * lock )
181183{
@@ -189,6 +191,19 @@ tas(volatile slock_t *lock)
189191return (int )ret ;
190192}
191193
194+ #else
195+
196+ static __inline__int
197+ tas (volatile slock_t * lock )
198+ {
199+ int ret ;
200+
201+ ret = _InterlockedExchange (lock ,1 );/* this is a xchg asm macro */
202+
203+ return ret ;
204+ }
205+
206+ #endif
192207#endif /* __ia64__ || __ia64 */
193208
194209