From 06464bd07cb1efbc9df4ca650978c14f4c20390a Mon Sep 17 00:00:00 2001 From: Ziv Scully Date: Thu, 12 Nov 2015 16:36:35 -0500 Subject: Fix committing multiple stores/flushes. Locking is WIP. --- include/urweb/types_cpp.h | 3 ++- include/urweb/urweb_cpp.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/urweb/types_cpp.h b/include/urweb/types_cpp.h index c4af2866..82f8d30a 100644 --- a/include/urweb/types_cpp.h +++ b/include/urweb/types_cpp.h @@ -121,6 +121,7 @@ typedef struct { // Caching +#include #include "uthash.h" typedef struct uw_Sqlcache_Value { @@ -132,7 +133,7 @@ typedef struct uw_Sqlcache_Value { typedef struct uw_Sqlcache_Entry uw_Sqlcache_Entry; typedef struct uw_Sqlcache_Cache { - //pthread_rwlock_t *lock; + pthread_rwlock_t lock; uw_Sqlcache_Entry *table; unsigned long timeInvalid; unsigned long timeNow; diff --git a/include/urweb/urweb_cpp.h b/include/urweb/urweb_cpp.h index 3e70b4ac..2c032e7b 100644 --- a/include/urweb/urweb_cpp.h +++ b/include/urweb/urweb_cpp.h @@ -406,8 +406,8 @@ void uw_Basis_writec(struct uw_context *, char); // Sqlcache. -uw_Sqlcache_Value *uw_Sqlcache_check(uw_Sqlcache_Cache *, char **); -void *uw_Sqlcache_store(uw_Sqlcache_Cache *, char **, uw_Sqlcache_Value *); +uw_Sqlcache_Value *uw_Sqlcache_check(struct uw_context *, uw_Sqlcache_Cache *, char **); +void *uw_Sqlcache_store(struct uw_context *, uw_Sqlcache_Cache *, char **, uw_Sqlcache_Value *); void *uw_Sqlcache_flush(struct uw_context *, uw_Sqlcache_Cache *, char **); #endif -- cgit v1.2.3