!6682 LWLock支持超时等锁、X锁降级机制

Merge pull request !6682 from hejiahuan11/LWLock
This commit is contained in:
opengauss_bot
2024-11-19 09:34:07 +00:00
committed by Gitee
7 changed files with 255 additions and 21 deletions

View File

@ -409,9 +409,11 @@ extern void DumpLWLockInfo();
extern LWLock* LWLockAssign(int trancheId, int tag = 0);
extern void LWLockInitialize(LWLock* lock, int tranche_id, int tag = 0);
extern bool LWLockAcquire(LWLock* lock, LWLockMode mode, bool need_update_lockid = false);
extern bool LWLockAcquireTimeout(LWLock* lock, LWLockMode mode, int timeout_ms);
extern bool LWLockConditionalAcquire(LWLock* lock, LWLockMode mode);
extern bool LWLockAcquireOrWait(LWLock* lock, LWLockMode mode);
extern void LWLockRelease(LWLock* lock);
extern void LWLockDowngrade(LWLock* lock);
extern void LWLockReleaseClearVar(LWLock* lock, uint64* valptr, uint64 val);
extern void LWLockReleaseAll(void);
extern bool LWLockHeldByMe(LWLock* lock);

View File

@ -81,6 +81,8 @@ extern void PGSemaphoreUnlock(PGSemaphore sema);
/* Lock a semaphore only if able to do so without blocking */
extern bool PGSemaphoreTryLock(PGSemaphore sema);
extern int PGSemaphoreLockTimeout(PGSemaphore sema, int timeout_ms);
extern void cancelSemphoreRelease(void);
#endif /* PG_SEMA_H */