• Robert Haas's avatar
    Assorted code review for recent ProcArrayLock patch. · 4aec4989
    Robert Haas authored
    Post-commit review by Andres Freund discovered a couple of concurrency
    bugs in the original patch: specifically, if the leader cleared a
    follower's XID before it reached PGSemaphoreLock, the semaphore would be
    left in the wrong state; and if another process did PGSemaphoreUnlock
    for some unrelated reason, we might resume execution before the fact
    that our XID was cleared was globally visible.
    
    Also, improve the wording of some comments, rename nextClearXidElem
    to firstClearXidElem in PROC_HDR for clarity, and drop some volatile
    qualifiers that aren't necessary.
    
    Amit Kapila, reviewed and slightly revised by me.
    4aec4989
procarray.c 118 KB