From 0271786bacdf9c12a142367a479b24ba111ebd17 Mon Sep 17 00:00:00 2001 From: Ziv Scully Date: Fri, 20 Nov 2015 11:51:14 -0500 Subject: Add read locks around time read in store. --- src/c/urweb.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/c/urweb.c') diff --git a/src/c/urweb.c b/src/c/urweb.c index 12009f02..a6639ef2 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -4815,7 +4815,9 @@ void uw_Sqlcache_store(uw_context ctx, uw_Sqlcache_Cache *cache, char **keys, uw update->value = value; update->next = NULL; // Can't use [uw_Sqlcache_getTimeNow] because it modifies state and we don't have the lock. + pthread_rwlock_rdlock(&cache->lockIn); value->timeValid = cache->timeNow; + pthread_rwlock_unlock(&cache->lockIn); if (ctx->cacheUpdateTail) { ctx->cacheUpdateTail->next = update; } else { -- cgit v1.2.3