OLD | NEW |
1 # 2008 June 17 | 1 # 2008 June 17 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 # can be selected using sqlite3_config: | 94 # can be selected using sqlite3_config: |
95 # | 95 # |
96 # * Serialized mode, | 96 # * Serialized mode, |
97 # * Multi-threaded mode, | 97 # * Multi-threaded mode, |
98 # * Single-threaded mode. | 98 # * Single-threaded mode. |
99 # | 99 # |
100 ifcapable threadsafe&&shared_cache { | 100 ifcapable threadsafe&&shared_cache { |
101 set enable_shared_cache [sqlite3_enable_shared_cache 1] | 101 set enable_shared_cache [sqlite3_enable_shared_cache 1] |
102 foreach {mode mutexes} { | 102 foreach {mode mutexes} { |
103 singlethread {} | 103 singlethread {} |
104 multithread {fast static_lru static_master static_mem static_open static_pr
ng } | 104 multithread { |
105 serialized {fast recursive static_lru static_master static_mem static_open
static_prng} | 105 fast static_lru static_master static_mem static_open static_prng |
| 106 static_pmem |
| 107 } |
| 108 serialized { |
| 109 fast recursive static_lru static_master static_mem static_open |
| 110 static_prng static_pmem |
| 111 } |
106 } { | 112 } { |
107 | 113 |
108 do_test mutex1.2.$mode.1 { | 114 do_test mutex1.2.$mode.1 { |
109 catch {db close} | 115 catch {db close} |
110 sqlite3_shutdown | 116 sqlite3_shutdown |
111 sqlite3_config $mode | 117 sqlite3_config $mode |
112 } SQLITE_OK | 118 } SQLITE_OK |
113 | 119 |
114 do_test mutex1.2.$mode.2 { | 120 do_test mutex1.2.$mode.2 { |
115 sqlite3_initialize | 121 sqlite3_initialize |
116 clear_mutex_counters | 122 clear_mutex_counters |
117 sqlite3 db test.db -nomutex 0 -fullmutex 0 | 123 sqlite3 db test.db -nomutex 0 -fullmutex 0 |
118 catchsql { CREATE TABLE abc(a, b, c) } | 124 catchsql { CREATE TABLE abc(a, b, c) } |
119 db eval { | 125 db eval { |
120 INSERT INTO abc VALUES(1, 2, 3); | 126 INSERT INTO abc VALUES(1, 2, 3); |
121 } | 127 } |
122 } {} | 128 } {} |
123 | 129 ifcapable !memorymanage { |
| 130 regsub { static_lru} $mutexes {} mutexes |
| 131 } |
124 do_test mutex1.2.$mode.3 { | 132 do_test mutex1.2.$mode.3 { |
125 mutex_counters counters | 133 mutex_counters counters |
126 | 134 |
127 set res [list] | 135 set res [list] |
128 foreach {key value} [array get counters] { | 136 foreach {key value} [array get counters] { |
129 if {$key ne "total" && $value > 0} { | 137 if {$key ne "total" && $value > 0} { |
130 lappend res $key | 138 lappend res $key |
131 } | 139 } |
132 } | 140 } |
133 lsort $res | 141 lsort $res |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 do_test mutex1-X { | 183 do_test mutex1-X { |
176 catch {db close} | 184 catch {db close} |
177 sqlite3_shutdown | 185 sqlite3_shutdown |
178 clear_mutex_counters | 186 clear_mutex_counters |
179 install_mutex_counters 0 | 187 install_mutex_counters 0 |
180 sqlite3_initialize | 188 sqlite3_initialize |
181 } {SQLITE_OK} | 189 } {SQLITE_OK} |
182 | 190 |
183 autoinstall_test_functions | 191 autoinstall_test_functions |
184 finish_test | 192 finish_test |
OLD | NEW |