diff --git a/pclsync/pfs.h b/pclsync/pfs.h index db14a3b..ae11a30 100644 --- a/pclsync/pfs.h +++ b/pclsync/pfs.h @@ -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);