| 53 | */ |
| 54 | static bool queryCancelFlag = false; |
| 55 | bool S3QueryIsAbortInProgress(void) { |
| 56 | bool queryIsBeingCancelled = QueryCancelPending || IsAbortInProgress(); |
| 57 | |
| 58 | // We need a thread-safe way to query and set queryCancelFlag. |
| 59 | // queryCancelFlag is set to TRUE for the first time when cancel signal is |
| 60 | // detected. If cancel signal is already captured, value will not be |
| 61 | // swapped and queryIsCancelledAlready is true. |
| 62 | bool queryIsCancelledAlready = |
| 63 | !__sync_bool_compare_and_swap(&queryCancelFlag, false, queryIsBeingCancelled); |
| 64 | |
| 65 | return queryIsBeingCancelled || queryIsCancelledAlready; |
| 66 | } |
| 67 | |
| 68 | void *S3Alloc(size_t size) { |
| 69 | return palloc(size); |
no test coverage detected