diff options
author | Vitaly Stoyan <[email protected]> | 2022-06-09 20:04:23 +0300 |
---|---|---|
committer | Vitaly Stoyan <[email protected]> | 2022-06-09 20:04:23 +0300 |
commit | 4258d2388ee66028a2ef9331bdd3ad46673c3a8e (patch) | |
tree | 668f5a2734086110bd25fc492c352f6d9b5d5dd7 | |
parent | a4ed292978685178afa68a53ca08075692768e01 (diff) |
YQL-13710 init latches for pg_sleep
ref:39ad9822849fca7087ad9bc5b7f7f3336aca5a20
-rw-r--r-- | ydb/library/yql/parser/pg_wrapper/parser.cpp | 10 | ||||
-rw-r--r-- | ydb/library/yql/parser/pg_wrapper/postgresql/src/backend/utils/init/miscinit.c | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/ydb/library/yql/parser/pg_wrapper/parser.cpp b/ydb/library/yql/parser/pg_wrapper/parser.cpp index 4f13ed66c72..f6d74a93411 100644 --- a/ydb/library/yql/parser/pg_wrapper/parser.cpp +++ b/ydb/library/yql/parser/pg_wrapper/parser.cpp @@ -26,6 +26,9 @@ extern "C" { #include "utils/resowner.h" #include "port/pg_bitutils.h" #include "port/pg_crc32c.h" +#include "postmaster/postmaster.h" +#include "storage/latch.h" +#include "miscadmin.h" #include "thread_inits.h" #undef Abs #undef Min @@ -47,6 +50,7 @@ extern "C" { extern "C" { +extern __thread Latch LocalLatchData; extern void destroy_timezone_hashtable(); const char *progname; @@ -308,4 +312,10 @@ extern "C" void setup_pg_thread_cleanup() { TopTransactionResourceOwner = owner; CurTransactionResourceOwner = owner; CurrentResourceOwner = owner; + + InitProcessGlobals(); + InitializeLatchSupport(); + MyLatch = &LocalLatchData; + InitLatch(MyLatch); + InitializeLatchWaitSet(); }; diff --git a/ydb/library/yql/parser/pg_wrapper/postgresql/src/backend/utils/init/miscinit.c b/ydb/library/yql/parser/pg_wrapper/postgresql/src/backend/utils/init/miscinit.c index 750aced60b3..1322d54359f 100644 --- a/ydb/library/yql/parser/pg_wrapper/postgresql/src/backend/utils/init/miscinit.c +++ b/ydb/library/yql/parser/pg_wrapper/postgresql/src/backend/utils/init/miscinit.c @@ -64,7 +64,7 @@ __thread BackendType MyBackendType; /* List of lock files to be removed at proc exit */ static __thread List *lock_files = NIL; -static __thread Latch LocalLatchData; +__thread Latch LocalLatchData; /* ---------------------------------------------------------------- * ignoring system indexes support stuff |