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
da99cce7
Commit
da99cce7
authored
Feb 12, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid delaying postmaster shutdown by up to 10 seconds on platforms
where signals do not terminate sleep() delays.
parent
4a1c29f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/bufmgr.c
+18
-2
No files found.
src/backend/storage/buffer/bufmgr.c
View file @
da99cce7
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.1
59 2004/02/12 15:06:56 wieck
Exp $
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.1
60 2004/02/12 20:07:26 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -943,6 +943,7 @@ BufferBackgroundWriter(void)
for
(;;)
{
int
n
;
long
udelay
;
/*
* Call BufferSync() with instructions to keep just the
...
...
@@ -970,8 +971,23 @@ BufferBackgroundWriter(void)
/*
* Nap for the configured time or sleep for 10 seconds if
* there was nothing to do at all.
*
* On some platforms, signals won't interrupt the sleep. To ensure
* we respond reasonably promptly when the postmaster signals us,
* break down the sleep into 1-second increments, and check for
* interrupts after each nap.
*/
pg_usleep
((
n
>
0
)
?
BgWriterDelay
*
1000L
:
10000000L
);
udelay
=
((
n
>
0
)
?
BgWriterDelay
:
10000
)
*
1000L
;
while
(
udelay
>
1000000L
)
{
pg_usleep
(
1000000L
);
udelay
-=
1000000L
;
if
(
InterruptPending
)
return
;
}
pg_usleep
(
udelay
);
if
(
InterruptPending
)
return
;
}
}
...
...
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