From 91c674495a5b01d6b4c036889ccdc7db285c7afe Mon Sep 17 00:00:00 2001 From: Rahim Kanji Date: Thu, 16 Oct 2025 12:35:15 +0500 Subject: [PATCH] Few fixes --- include/PgSQL_Session.h | 2 +- lib/PgSQL_PreparedStatement.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/PgSQL_Session.h b/include/PgSQL_Session.h index 09789b5c6..27298b8a5 100644 --- a/include/PgSQL_Session.h +++ b/include/PgSQL_Session.h @@ -239,7 +239,7 @@ private: bool extended_query_exec_qp { false }; uint8_t extended_query_phase { EXTQ_PHASE_IDLE }; std::queue extended_query_frame; - std::unique_ptr bind_waiting_for_execute{}; + std::unique_ptr bind_waiting_for_execute; //int handler_ret; void handler___status_CONNECTING_CLIENT___STATE_SERVER_HANDSHAKE(PtrSize_t*, bool*); diff --git a/lib/PgSQL_PreparedStatement.cpp b/lib/PgSQL_PreparedStatement.cpp index 4dfda9e5e..2d6d7118b 100644 --- a/lib/PgSQL_PreparedStatement.cpp +++ b/lib/PgSQL_PreparedStatement.cpp @@ -162,7 +162,7 @@ PgSQL_STMT_Manager_v14::~PgSQL_STMT_Manager_v14() { void PgSQL_STMT_Manager_v14::ref_count_client(uint64_t _stmt_id ,int _v, bool lock) noexcept { if (lock) - pthread_rwlock_wrlock(&rwlock_); + wrlock(); if (auto s = map_stmt_id_to_info.find(_stmt_id); s != map_stmt_id_to_info.end()) { statuses.c_total += _v; @@ -222,12 +222,12 @@ void PgSQL_STMT_Manager_v14::ref_count_client(uint64_t _stmt_id ,int _v, bool lo } } if (lock) - pthread_rwlock_unlock(&rwlock_); + unlock(); } void PgSQL_STMT_Manager_v14::ref_count_server(uint64_t _stmt_id ,int _v, bool lock) noexcept { if (lock) - pthread_rwlock_wrlock(&rwlock_); + wrlock(); std::map::iterator s; s = map_stmt_id_to_info.find(_stmt_id); if (s != map_stmt_id_to_info.end()) { @@ -243,7 +243,7 @@ void PgSQL_STMT_Manager_v14::ref_count_server(uint64_t _stmt_id ,int _v, bool lo stmt_info->ref_count_server += _v; } if (lock) - pthread_rwlock_unlock(&rwlock_); + unlock(); } PgSQL_STMTs_local_v14::~PgSQL_STMTs_local_v14() { @@ -388,7 +388,7 @@ PgSQL_STMT_Global_info* PgSQL_STMT_Manager_v14::add_prepared_statement( ret->ref_count_server++; statuses.s_total++; if (lock) { - pthread_rwlock_unlock(&rwlock_); + unlock(); } return ret; } @@ -458,7 +458,7 @@ void PgSQL_STMT_Manager_v14::get_metrics(uint64_t *c_unique, uint64_t *c_total, *cached = statuses.cached; *s_total = statuses.s_total; *s_unique = statuses.s_unique; - pthread_rwlock_unlock(&rwlock_); + unlock(); }