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

Commit6e459f8

Browse files
Maksim MilyutinMaksim Milyutin
Maksim Milyutin
authored and
Maksim Milyutin
committed
Fix place of acquiring lock
1 parentb383d38 commit6e459f8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

‎userid_rpc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ uirpcShmemInit()
9090
staticvoid
9191
SendCurrentUserId(void)
9292
{
93+
LWLockAcquire(resptr->lock,LW_EXCLUSIVE);
9394
LWLockUpdateVar(resptr->lock, (uint64*)&resptr->userid,GetUserId());
95+
LWLockRelease(resptr->lock);
9496
}
9597

9698
/*
@@ -125,8 +127,6 @@ GetRemoteBackendUserId(PGPROC *proc)
125127
Assert(resptr!=NULL);
126128
Assert(proc&&proc!=MyProc&&proc->backendId!=InvalidBackendId);
127129

128-
LWLockAcquire(resptr->lock,LW_EXCLUSIVE);
129-
130130
sig_result=SendProcSignal(proc->pid,UserPollReason,proc->backendId);
131131
if (sig_result==-1)
132132
ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
@@ -138,7 +138,5 @@ GetRemoteBackendUserId(PGPROC *proc)
138138
result,
139139
(uint64*)&result);
140140

141-
LWLockRelease(resptr->lock);
142-
143141
returnresult;
144142
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp