From 51b892440b8e59ad288c0e0c84bd3d5e75501ab1 Mon Sep 17 00:00:00 2001 From: kanoi Date: Mon, 28 Dec 2015 23:13:48 +1100 Subject: [PATCH] ckdb - correct lock type in cmd_setopts --- src/ckdb.h | 2 +- src/ckdb_cmd.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ckdb.h b/src/ckdb.h index 73994d98..163cf8e7 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -55,7 +55,7 @@ #define DB_VLOCK "1" #define DB_VERSION "1.0.4" -#define CKDB_VERSION DB_VERSION"-1.703" +#define CKDB_VERSION DB_VERSION"-1.704" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__ diff --git a/src/ckdb_cmd.c b/src/ckdb_cmd.c index daee8254..a7cde8a7 100644 --- a/src/ckdb_cmd.c +++ b/src/ckdb_cmd.c @@ -3959,9 +3959,9 @@ static char *cmd_setopts(PGconn *conn, char *cmd, char *id, } } if (!oc_item) { - K_RLOCK(optioncontrol_free); + K_WLOCK(optioncontrol_free); oc_item = k_unlink_head(optioncontrol_free); - K_RUNLOCK(optioncontrol_free); + K_WUNLOCK(optioncontrol_free); DATA_OPTIONCONTROL(optioncontrol, oc_item); bzero(optioncontrol, sizeof(*optioncontrol)); STRNCPY(optioncontrol->optionname, optionname);