Fixes:
Originally, I thought the problem was caused by a function that gets called as a normal function where we want to return a value, and as a signal handler where we need to have it accept a parameter (the signal number) and it returns nothing, I was going to case the function name in the signal call as (void (*)(int)). Looking at all the source, it turns out this function only gets used as a signal handler, so I set an int parameter and return void. I have removed the Linux defines because they are not needed. BSD let this sloppiness slide. Linux gave a compile error. Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>
This commit is contained in:
parent
4d837e370c
commit
164ef6ff2b
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.4 1996/07/31 02:19:09 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.5 1996/08/01 05:11:33 scrappy Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -46,7 +46,7 @@
|
|||||||
* This is so that we can support more backends. (system-wide semaphore
|
* This is so that we can support more backends. (system-wide semaphore
|
||||||
* sets run out pretty fast.) -ay 4/95
|
* sets run out pretty fast.) -ay 4/95
|
||||||
*
|
*
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.4 1996/07/31 02:19:09 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.5 1996/08/01 05:11:33 scrappy Exp $
|
||||||
*/
|
*/
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
@ -95,11 +95,6 @@ PROC *MyProc = NULL;
|
|||||||
static void ProcKill(int exitStatus, int pid);
|
static void ProcKill(int exitStatus, int pid);
|
||||||
static void ProcGetNewSemKeyAndNum(IPCKey *key, int *semNum);
|
static void ProcGetNewSemKeyAndNum(IPCKey *key, int *semNum);
|
||||||
static void ProcFreeSem(IpcSemaphoreKey semKey, int semNum);
|
static void ProcFreeSem(IpcSemaphoreKey semKey, int semNum);
|
||||||
#if defined(PORTNAME_linux)
|
|
||||||
extern void HandleDeadLock(int);
|
|
||||||
#else
|
|
||||||
extern int HandleDeadLock(void);
|
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
* InitProcGlobal -
|
* InitProcGlobal -
|
||||||
* initializes the global process table. We put it here so that
|
* initializes the global process table. We put it here so that
|
||||||
@ -628,13 +623,8 @@ ProcAddLock(SHM_QUEUE *elem)
|
|||||||
* up my semaphore.
|
* up my semaphore.
|
||||||
* --------------------
|
* --------------------
|
||||||
*/
|
*/
|
||||||
#if defined(PORTNAME_linux)
|
void
|
||||||
void
|
HandleDeadLock(int sig)
|
||||||
HandleDeadLock(int i)
|
|
||||||
#else
|
|
||||||
int
|
|
||||||
HandleDeadLock()
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
LOCK *lock;
|
LOCK *lock;
|
||||||
int size;
|
int size;
|
||||||
@ -654,7 +644,7 @@ HandleDeadLock()
|
|||||||
if (IpcSemaphoreGetCount(MyProc->sem.semId, MyProc->sem.semNum) ==
|
if (IpcSemaphoreGetCount(MyProc->sem.semId, MyProc->sem.semNum) ==
|
||||||
IpcSemaphoreDefaultStartValue) {
|
IpcSemaphoreDefaultStartValue) {
|
||||||
UnlockLockTable();
|
UnlockLockTable();
|
||||||
return 1;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -671,7 +661,7 @@ HandleDeadLock()
|
|||||||
if (MyProc->links.prev == INVALID_OFFSET ||
|
if (MyProc->links.prev == INVALID_OFFSET ||
|
||||||
MyProc->links.next == INVALID_OFFSET) {
|
MyProc->links.next == INVALID_OFFSET) {
|
||||||
UnlockLockTable();
|
UnlockLockTable();
|
||||||
return(1);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lock = MyProc->waitLock;
|
lock = MyProc->waitLock;
|
||||||
@ -708,7 +698,7 @@ HandleDeadLock()
|
|||||||
UnlockLockTable();
|
UnlockLockTable();
|
||||||
|
|
||||||
elog(NOTICE, "Timeout -- possible deadlock");
|
elog(NOTICE, "Timeout -- possible deadlock");
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: proc.h,v 1.1.1.1 1996/07/09 06:21:53 scrappy Exp $
|
* $Id: proc.h,v 1.2 1996/08/01 05:10:16 scrappy Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -116,11 +116,7 @@ extern PROC *ProcWakeup(PROC *proc, int errType);
|
|||||||
extern int ProcGetId(void);
|
extern int ProcGetId(void);
|
||||||
extern int ProcLockWakeup(PROC_QUEUE *queue, char * ltable, char * lock);
|
extern int ProcLockWakeup(PROC_QUEUE *queue, char * ltable, char * lock);
|
||||||
extern void ProcAddLock(SHM_QUEUE *elem);
|
extern void ProcAddLock(SHM_QUEUE *elem);
|
||||||
#if defined(PORTNAME_linux)
|
extern void HandleDeadLock(int sig);
|
||||||
extern int HandleDeadLock(int);
|
|
||||||
#else
|
|
||||||
extern int HandleDeadLock(void);
|
|
||||||
#endif
|
|
||||||
extern void ProcReleaseSpins(PROC *proc);
|
extern void ProcReleaseSpins(PROC *proc);
|
||||||
extern void ProcFreeAllSemaphores(void);
|
extern void ProcFreeAllSemaphores(void);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user