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

Commit550f209

Browse files
committed
Move common lock code to their own section.
1 parenta93f397 commit550f209

File tree

1 file changed

+52
-50
lines changed

1 file changed

+52
-50
lines changed

‎src/include/storage/s_lock.h

Lines changed: 52 additions & 50 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.38 1998/07/18 14:51:10 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.39 1998/07/18 14:58:58 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -170,39 +170,6 @@ tas(volatile slock_t *lock)
170170
* All non gcc
171171
*/
172172

173-
#if defined (nextstep)
174-
/*
175-
* NEXTSTEP (mach)
176-
* slock_t is defined as a struct mutex.
177-
*/
178-
179-
#defineS_LOCK(lock)mutex_lock(lock)
180-
#defineS_UNLOCK(lock)mutex_unlock(lock)
181-
#defineS_INIT_LOCK(lock)mutex_init(lock)
182-
/* For Mach, we have to delve inside the entrails of `struct mutex'. Ick! */
183-
#defineS_LOCK_FREE(alock)((alock)->lock == 0)
184-
#endif/* nextstep */
185-
186-
187-
188-
#if defined(__sgi)
189-
/*
190-
* SGI IRIX 5
191-
* slock_t is defined as a struct abilock_t, which has a single unsigned long
192-
* member.
193-
*
194-
* This stuff may be supplemented in the future with Masato Kataoka's MIPS-II
195-
* assembly from his NECEWS SVR4 port, but we probably ought to retain this
196-
* for the R3000 chips out there.
197-
*/
198-
#defineTAS(lock)(!acquire_lock(lock))
199-
#defineS_UNLOCK(lock)release_lock(lock)
200-
#defineS_INIT_LOCK(lock)init_lock(lock)
201-
#defineS_LOCK_FREE(lock)(stat_lock(lock) == UNLOCKED)
202-
#endif/* __sgi */
203-
204-
205-
206173
#if defined(__alpha)
207174
/*
208175
* OSF/1 (Alpha AXP)
@@ -218,23 +185,9 @@ tas(volatile slock_t *lock)
218185

219186

220187

221-
#if defined(_AIX)
222-
/*
223-
* AIX (POWER)
224-
*
225-
* Note that slock_t on POWER/POWER2/PowerPC is int instead of char
226-
* (see storage/ipc.h).
227-
*/
228-
#defineTAS(lock)cs((int *) (lock), 0, 1)
229-
#endif/* _AIX */
230-
231-
232-
233-
234188
#if defined(NEED_I386_TAS_ASM)
235189
/* non gcc i386 based things */
236190

237-
238191
#if defined(USE_UNIVEL_CC)
239192
#defineTAS(lock)tas(lock)
240193

@@ -253,11 +206,16 @@ tas(slock_t *s_lock)
253206
}
254207
#endif/* USE_UNIVEL_CC */
255208

256-
257209
#endif/* NEED_I386_TAS_ASM */
258210

259211

260-
#endif/* else defined(__GNUC__) */
212+
#endif/* defined(__GNUC__) */
213+
214+
215+
216+
/*************************************************************************
217+
* These are the platforms that have common code for gcc and non-gcc
218+
*/
261219

262220
#if defined(__hpux)
263221
/*
@@ -277,6 +235,50 @@ static const slock_t clear_lock =
277235
#endif/* __hpux */
278236

279237

238+
#if defined(__sgi)
239+
/*
240+
* SGI IRIX 5
241+
* slock_t is defined as a struct abilock_t, which has a single unsigned long
242+
* member.
243+
*
244+
* This stuff may be supplemented in the future with Masato Kataoka's MIPS-II
245+
* assembly from his NECEWS SVR4 port, but we probably ought to retain this
246+
* for the R3000 chips out there.
247+
*/
248+
#defineTAS(lock)(!acquire_lock(lock))
249+
#defineS_UNLOCK(lock)release_lock(lock)
250+
#defineS_INIT_LOCK(lock)init_lock(lock)
251+
#defineS_LOCK_FREE(lock)(stat_lock(lock) == UNLOCKED)
252+
#endif/* __sgi */
253+
254+
255+
#if defined(_AIX)
256+
/*
257+
* AIX (POWER)
258+
*
259+
* Note that slock_t on POWER/POWER2/PowerPC is int instead of char
260+
* (see storage/ipc.h).
261+
*/
262+
#defineTAS(lock)cs((int *) (lock), 0, 1)
263+
#endif/* _AIX */
264+
265+
266+
#if defined (nextstep)
267+
/*
268+
* NEXTSTEP (mach)
269+
* slock_t is defined as a struct mutex.
270+
*/
271+
272+
#defineS_LOCK(lock)mutex_lock(lock)
273+
#defineS_UNLOCK(lock)mutex_unlock(lock)
274+
#defineS_INIT_LOCK(lock)mutex_init(lock)
275+
/* For Mach, we have to delve inside the entrails of `struct mutex'. Ick! */
276+
#defineS_LOCK_FREE(alock)((alock)->lock == 0)
277+
#endif/* nextstep */
278+
279+
280+
281+
280282
/****************************************************************************
281283
* Default Definitions - override these above as needed.
282284
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp