Add lock ordering assertions for psql_lock → file mutex
This commit is contained in:
parent
d0c213f181
commit
ae046a2e38
|
|
@ -145,6 +145,10 @@ typedef struct {
|
|||
extern PSYNC_THREAD const char *psync_thread_name;
|
||||
static inline int pfs_do_lock_file(psync_openfile_t *of, const char *file,
|
||||
unsigned long line) {
|
||||
if (!psql_locked()) {
|
||||
pdbg_logf(D_ERROR, "lock ordering violation: pfs_lock_file called without psql_lock at %s:%lu", file, line);
|
||||
abort();
|
||||
}
|
||||
if (unlikely(pthread_mutex_trylock(&of->mutex))) {
|
||||
struct timespec tm;
|
||||
clock_gettime(CLOCK_REALTIME, &tm);
|
||||
|
|
|
|||
Loading…
Reference in New Issue