aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/lru_cache.sml
diff options
context:
space:
mode:
authorGravatar Ziv Scully <ziv@mit.edu>2015-11-13 11:03:09 -0500
committerGravatar Ziv Scully <ziv@mit.edu>2015-11-13 11:03:09 -0500
commitbad52a2868ff0551ac0199fd8124f81f9623391e (patch)
treecaea90cb436e3646b031734b0b429c0d0a28d8d9 /src/lru_cache.sml
parentd67e2a35789c5e4c7ad603c15d2acdc826fcdc76 (diff)
Finish locking, but it's not yet tested rigorously.
Diffstat (limited to 'src/lru_cache.sml')
-rw-r--r--src/lru_cache.sml20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/lru_cache.sml b/src/lru_cache.sml
index b66becb7..0276de91 100644
--- a/src/lru_cache.sml
+++ b/src/lru_cache.sml
@@ -69,7 +69,9 @@ fun setupQuery {index, params} =
Print.box
[string ("static uw_Sqlcache_Cache cacheStruct" ^ i ^ " = {"),
newline,
- string " .lock = PTHREAD_RWLOCK_INITIALIZER,",
+ string " .lockIn = PTHREAD_RWLOCK_INITIALIZER,",
+ newline,
+ string " .lockOut = PTHREAD_RWLOCK_INITIALIZER,",
newline,
string " .table = NULL,",
newline,
@@ -83,6 +85,22 @@ fun setupQuery {index, params} =
newline,
newline,
+ string ("static void uw_Sqlcache_rlock" ^ i ^ "(uw_context ctx) {"),
+ newline,
+ string (" uw_Sqlcache_rlock(ctx, cache" ^ i ^ ");"),
+ newline,
+ string "}",
+ newline,
+ newline,
+
+ string ("static void uw_Sqlcache_wlock" ^ i ^ "(uw_context ctx) {"),
+ newline,
+ string (" uw_Sqlcache_wlock(ctx, cache" ^ i ^ ");"),
+ newline,
+ string "}",
+ newline,
+ newline,
+
string ("static uw_Basis_string uw_Sqlcache_check" ^ i),
string ("(uw_context ctx" ^ typedArgs ^ ") {"),
newline,