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

Commitf017d7e

Browse files
author
Hiroshi Inoue
committed
Check pending cancel request before waiting for lock
1 parenta5e9445 commitf017d7e

File tree

1 file changed

+21
-3
lines changed
  • src/backend/storage/lmgr

1 file changed

+21
-3
lines changed

‎src/backend/storage/lmgr/proc.c

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.69 2000/02/22 09:55:20 inoue Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.70 2000/02/24 04:36:01 inoue Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -47,7 +47,7 @@
4747
*This is so that we can support more backends. (system-wide semaphore
4848
*sets run out pretty fast.) -ay 4/95
4949
*
50-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.69 2000/02/22 09:55:20 inoue Exp $
50+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.70 2000/02/24 04:36:01 inoue Exp $
5151
*/
5252
#include<sys/time.h>
5353
#include<unistd.h>
@@ -481,10 +481,28 @@ ProcQueueInit(PROC_QUEUE *queue)
481481
}
482482

483483

484+
/*
485+
*Handling cancel request while waiting for lock
486+
*
487+
*/
484488
staticboollockWaiting= false;
485489
voidSetWaitingForLock(boolwaiting)
486490
{
491+
if (waiting==lockWaiting)
492+
return;
487493
lockWaiting=waiting;
494+
if (lockWaiting)
495+
{
496+
Assert(MyProc->links.next!=INVALID_OFFSET);
497+
if (QueryCancel)/* cancel request pending */
498+
{
499+
if (GetOffWaitqueue(MyProc))
500+
{
501+
lockWaiting= false;
502+
elog(ERROR,"Query cancel requested while waiting lock");
503+
}
504+
}
505+
}
488506
}
489507
voidLockWaitCancel(void)
490508
{
@@ -610,7 +628,7 @@ ins:;
610628
timeval.it_value.tv_sec= \
611629
(DeadlockCheckTimer ?DeadlockCheckTimer :DEADLOCK_CHECK_TIMER);
612630

613-
lockWaiting=true;
631+
SetWaitingForLock(true);
614632
do
615633
{
616634
MyProc->errType=NO_ERROR;/* reset flag after deadlock check */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp