|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * 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 $ |
12 | 12 | * |
13 | 13 | *------------------------------------------------------------------------- |
14 | 14 | */ |
|
47 | 47 | *This is so that we can support more backends. (system-wide semaphore |
48 | 48 | *sets run out pretty fast.) -ay 4/95 |
49 | 49 | * |
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 $ |
51 | 51 | */ |
52 | 52 | #include<sys/time.h> |
53 | 53 | #include<unistd.h> |
@@ -481,10 +481,28 @@ ProcQueueInit(PROC_QUEUE *queue) |
481 | 481 | } |
482 | 482 |
|
483 | 483 |
|
| 484 | +/* |
| 485 | + *Handling cancel request while waiting for lock |
| 486 | + * |
| 487 | + */ |
484 | 488 | staticboollockWaiting= false; |
485 | 489 | voidSetWaitingForLock(boolwaiting) |
486 | 490 | { |
| 491 | +if (waiting==lockWaiting) |
| 492 | +return; |
487 | 493 | 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 | +} |
488 | 506 | } |
489 | 507 | voidLockWaitCancel(void) |
490 | 508 | { |
@@ -610,7 +628,7 @@ ins:; |
610 | 628 | timeval.it_value.tv_sec= \ |
611 | 629 | (DeadlockCheckTimer ?DeadlockCheckTimer :DEADLOCK_CHECK_TIMER); |
612 | 630 |
|
613 | | -lockWaiting=true; |
| 631 | +SetWaitingForLock(true); |
614 | 632 | do |
615 | 633 | { |
616 | 634 | MyProc->errType=NO_ERROR;/* reset flag after deadlock check */ |
|