Changeset 1b20da0 in mainline for kernel/test/synch/workq-test-core.h
- Timestamp:
- 2018-02-28T17:52:03Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3061bc1
- Parents:
- df6ded8
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/synch/workq-test-core.h
rdf6ded8 r1b20da0 111 111 --work->count_down; 112 112 113 /* 114 * Enqueue a child if count_down is power-of-2. 115 * Leads to exponential growth. 113 /* 114 * Enqueue a child if count_down is power-of-2. 115 * Leads to exponential growth. 116 116 */ 117 117 if (is_pow2(work->count_down + 1)) { … … 124 124 125 125 if (!core_workq_enqueue(work_item, reproduce)) { 126 if (work->master) 126 if (work->master) 127 127 TPRINTF("\nErr: Master work item exiting prematurely!\n"); 128 128 … … 161 161 * k == COUNT_POW 162 162 * 2^k == COUNT + 1 163 * 163 * 164 164 * We have "k" branching points. Therefore: 165 165 * exp_call_cnt == k*2^(k-1) + 2^k == (k + 2) * 2^(k-1) … … 167 167 size_t exp_call_cnt = (COUNT_POW + 2) * (1 << (COUNT_POW - 1)); 168 168 169 TPRINTF("waves: %d, count_down: %d, total expected calls: %zu\n", 169 TPRINTF("waves: %d, count_down: %d, total expected calls: %zu\n", 170 170 WAVES, COUNT, exp_call_cnt * WAVES); 171 171 … … 179 179 180 180 for (int i = 0; i < WAVES; ++i) { 181 while (atomic_get(&call_cnt[i]) < exp_call_cnt 181 while (atomic_get(&call_cnt[i]) < exp_call_cnt 182 182 && sleep_cnt < max_sleep_cnt) { 183 183 TPRINTF("."); … … 197 197 TPRINTF("Error: %" PRIua " calls in wave %d, but %zu expected.\n", 198 198 atomic_get(&call_cnt[i]), i, exp_call_cnt); 199 } 199 } 200 200 } 201 201
Note:
See TracChangeset
for help on using the changeset viewer.