diff src/lru_cache.sml @ 2288:98f96a976ede

Finish locking, but it's not yet tested rigorously.
author Ziv Scully <ziv@mit.edu>
date Fri, 13 Nov 2015 11:03:09 -0500
parents 0bdfec16a01d
children 78820fa8f5a7
line wrap: on
line diff
--- a/src/lru_cache.sml	Fri Nov 13 01:05:22 2015 -0500
+++ b/src/lru_cache.sml	Fri Nov 13 11:03:09 2015 -0500
@@ -69,7 +69,9 @@
         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 @@
              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,