Skip to content

Commit

Permalink
Fix s_lock_test compile
Browse files Browse the repository at this point in the history
This is a mostly unused tool, but I discovered while nosing around the
Makefile that it hasn't been kept in line with other changes.  Fix it.

Backpatching doesn't appear to be necessary.

Discussion: https://postgr.es/m/202401241114.ied53jcich72@alvherre.pgsql
  • Loading branch information
alvherre committed Jan 25, 2024
1 parent fba2112 commit 4677818
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/backend/storage/lmgr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ endif
s_lock_test: s_lock.c $(top_builddir)/src/common/libpgcommon.a $(top_builddir)/src/port/libpgport.a
$(CC) $(CPPFLAGS) $(CFLAGS) -DS_LOCK_TEST=1 $(srcdir)/s_lock.c \
$(TASPATH) -L $(top_builddir)/src/common -lpgcommon \
-L $(top_builddir)/src/port -lpgport -o s_lock_test
-L $(top_builddir)/src/port -lpgport -lm -o s_lock_test

# see notes in src/backend/parser/Makefile
lwlocknames.c: lwlocknames.h
Expand Down
8 changes: 8 additions & 0 deletions src/backend/storage/lmgr/s_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
#define MIN_DELAY_USEC 1000L
#define MAX_DELAY_USEC 1000000L

#ifdef S_LOCK_TEST
/*
* These are needed by pgstat_report_wait_start in the standalone compile of
* s_lock_test.
*/
static uint32 local_my_wait_event_info;
uint32 *my_wait_event_info = &local_my_wait_event_info;
#endif

slock_t dummy_spinlock;

Expand Down

0 comments on commit 4677818

Please sign in to comment.