MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / decompression_workload_runner

Function decompression_workload_runner

Source/astcenccli_toplevel.cpp:276–298  ·  view source on GitHub ↗

* @brief Runner callback function for a decompression worker thread. * * @param thread_count The number of threads in the worker pool. * @param thread_id The index of this thread in the worker pool. * @param payload The parameters for this thread. */

Source from the content-addressed store, hash-verified

274 * @param payload The parameters for this thread.
275 */
276static void decompression_workload_runner(
277 int thread_count,
278 int thread_id,
279 void* payload
280) {
281 (void)thread_count;
282
283 char name[16] { 0 };
284 std::snprintf(name, 16, "astc workd %d", thread_id);
285 set_thread_name(name);
286
287 decompression_workload* work = static_cast<decompression_workload*>(payload);
288 astcenc_error error = astcenc_decompress_image(
289 work->context, work->data, work->data_len,
290 work->image_out, &work->swizzle, thread_id);
291
292 // This is a racy update, so which error gets returned is a random, but it
293 // will reliably report an error if an error occurs
294 if (error != ASTCENC_SUCCESS)
295 {
296 work->error = error;
297 }
298}
299
300/**
301 * @brief Utility to generate a slice file name from a pattern.

Callers

nothing calls this directly

Calls 2

set_thread_nameFunction · 0.85
astcenc_decompress_imageFunction · 0.85

Tested by

no test coverage detected