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

Commit9032918

Browse files
author
Nikita Glukhov
committed
Add GetSharedBackgroundWorkerHandle()
1 parente4e940c commit9032918

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎src/backend/postmaster/bgworker.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,16 @@ RegisterDynamicBackgroundWorker(BackgroundWorker *worker,
10281028
returnsuccess;
10291029
}
10301030

1031+
BackgroundWorkerHandle*
1032+
GetSharedBackgroundWorkerHandle(BackgroundWorkerHandle*handle,
1033+
BackgroundWorkerHandle**shhandle)
1034+
{
1035+
if (!*shhandle)
1036+
*shhandle=ShmemAlloc(sizeof(*handle));
1037+
memcpy(*shhandle,handle,sizeof(*handle));
1038+
return*shhandle;
1039+
}
1040+
10311041
/*
10321042
* Get the PID of a dynamically-registered background worker.
10331043
*

‎src/include/postmaster/bgworker.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ extern BgwHandleStatus
128128
/* Terminate a bgworker */
129129
externvoidTerminateBackgroundWorker(BackgroundWorkerHandle*handle);
130130

131+
externBackgroundWorkerHandle*
132+
GetSharedBackgroundWorkerHandle(BackgroundWorkerHandle*handle,
133+
BackgroundWorkerHandle**shhandle);
134+
131135
/* This is valid in a running worker */
132136
externPGDLLIMPORTBackgroundWorker*MyBgworkerEntry;
133137

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp