Mercurial > urweb
comparison src/lru_cache.sml @ 2284:472b4504aef2
Actually use transactional machinery for flushes this time.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Thu, 12 Nov 2015 11:44:21 -0500 |
parents | 75cb60a7f6f1 |
children | ad3ce1528f71 |
comparison
equal
deleted
inserted
replaced
2283:4afaab523213 | 2284:472b4504aef2 |
---|---|
63 val revArgs = paramRepeatRev (fn p => "p" ^ p) ", " | 63 val revArgs = paramRepeatRev (fn p => "p" ^ p) ", " |
64 | 64 |
65 in | 65 in |
66 Print.box | 66 Print.box |
67 [string ("static uw_Sqlcache_Cache cacheStruct" ^ i ^ " = {"), | 67 [string ("static uw_Sqlcache_Cache cacheStruct" ^ i ^ " = {"), |
68 (* newline, *) | |
69 (* string " .lock = PTHREAD_RWLOCK_INITIALIZER,", *) | |
68 newline, | 70 newline, |
69 string " .table = NULL,", | 71 string " .table = NULL,", |
70 newline, | 72 newline, |
71 string (" .numKeys = " ^ Int.toString params ^ ","), | 73 string (" .numKeys = " ^ Int.toString params ^ ","), |
72 newline, | 74 newline, |
132 string ("static uw_unit uw_Sqlcache_flush" ^ i), | 134 string ("static uw_unit uw_Sqlcache_flush" ^ i), |
133 string ("(uw_context ctx" ^ typedArgs ^ ") {"), | 135 string ("(uw_context ctx" ^ typedArgs ^ ") {"), |
134 newline, | 136 newline, |
135 string (" char *ks[] = {" ^ revArgs ^ "};"), | 137 string (" char *ks[] = {" ^ revArgs ^ "};"), |
136 newline, | 138 newline, |
137 string (" uw_Sqlcache_flush(cache" ^ i ^ ", ks);"), | 139 string (" uw_Sqlcache_flush(ctx, cache" ^ i ^ ", ks);"), |
138 newline, | 140 newline, |
139 string " return uw_unit_v;", | 141 string " return uw_unit_v;", |
140 newline, | 142 newline, |
141 string "}", | 143 string "}", |
142 newline, | 144 newline, |