Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
4c313931
Commit
4c313931
authored
Feb 19, 1999
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder startup ops so that if preallocation of semas fails,
postmaster will release whatever it did get before dying.
parent
e77b630c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
src/backend/storage/ipc/ipci.c
src/backend/storage/ipc/ipci.c
+1
-2
src/backend/storage/lmgr/proc.c
src/backend/storage/lmgr/proc.c
+12
-3
src/include/storage/proc.h
src/include/storage/proc.h
+1
-2
No files found.
src/backend/storage/ipc/ipci.c
View file @
4c313931
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.
19 1999/02/19 06:06:04
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.
20 1999/02/19 07:10:47
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -101,7 +101,6 @@ CreateSharedMemoryAndSemaphores(IPCKey key, int maxBackends)
* ----------------
*/
InitProcGlobal
(
key
,
maxBackends
);
on_shmem_exit
(
ProcFreeAllSemaphores
,
NULL
);
CreateSharedInvalidationState
(
key
);
}
...
...
src/backend/storage/lmgr/proc.c
View file @
4c313931
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.
49 1999/02/19 06:06:0
8 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.
50 1999/02/19 07:10:4
8 tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -46,7 +46,7 @@
* This is so that we can support more backends. (system-wide semaphore
* sets run out pretty fast.) -ay 4/95
*
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.
49 1999/02/19 06:06:0
8 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.
50 1999/02/19 07:10:4
8 tgl Exp $
*/
#include <sys/time.h>
#include <unistd.h>
...
...
@@ -79,6 +79,7 @@
static
void
HandleDeadLock
(
int
sig
);
static
PROC
*
ProcWakeup
(
PROC
*
proc
,
int
errType
);
static
void
ProcFreeAllSemaphores
(
void
);
#define DeadlockCheckTimer pg_options[OPT_DEADLOCKTIMEOUT]
...
...
@@ -135,6 +136,8 @@ InitProcGlobal(IPCKey key, int maxBackends)
/* --------------------
* We're the first - initialize.
* XXX if found should ever be true, it is a sign of impending doom ...
* ought to complain if so?
* --------------------
*/
if
(
!
found
)
...
...
@@ -145,6 +148,12 @@ InitProcGlobal(IPCKey key, int maxBackends)
ProcGlobal
->
currKey
=
IPCGetProcessSemaphoreInitKey
(
key
);
for
(
i
=
0
;
i
<
MAX_PROC_SEMS
/
PROC_NSEMS_PER_SET
;
i
++
)
ProcGlobal
->
freeSemMap
[
i
]
=
0
;
/* Arrange to delete semas on exit --- set this up now so that
* we will clean up if pre-allocation fails...
*/
on_shmem_exit
(
ProcFreeAllSemaphores
,
NULL
);
/* Pre-create the semaphores for the first maxBackends processes */
for
(
i
=
0
;
i
<
(
maxBackends
+
PROC_NSEMS_PER_SET
-
1
)
/
PROC_NSEMS_PER_SET
;
...
...
@@ -924,7 +933,7 @@ ProcFreeSem(IpcSemaphoreKey semKey, int semNum)
* destroying shared state for a failed set of backends.
* Free up all the semaphores allocated to the lmgrs of the backends.
*/
void
static
void
ProcFreeAllSemaphores
()
{
int
i
;
...
...
src/include/storage/proc.h
View file @
4c313931
...
...
@@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: proc.h,v 1.
19 1999/02/19 06:06:3
7 tgl Exp $
* $Id: proc.h,v 1.
20 1999/02/19 07:10:4
7 tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -122,6 +122,5 @@ extern int ProcLockWakeup(PROC_QUEUE *queue, LOCKMETHOD lockmethod,
LOCK
*
lock
);
extern
void
ProcAddLock
(
SHM_QUEUE
*
elem
);
extern
void
ProcReleaseSpins
(
PROC
*
proc
);
extern
void
ProcFreeAllSemaphores
(
void
);
#endif
/* PROC_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment