mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-10 12:41:35 -10:00
* Dispatch ship weapon collisions and defer handling * multithread ship weapon collision * properly spin * proper memory order * externalize generic threadpool settings * Wait for threads to shut down * Add result pipelining * cleanup * incorrect nullopt type * randomrange todo * parallelize ship ship collisions * bogus debug return * remove warnings * clang tidy
19 lines
518 B
C++
19 lines
518 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
namespace threading {
|
|
enum class WorkerThreadTask : uint8_t { EXIT, COLLISION };
|
|
|
|
//Call this to start a task on the task pool. Note that task-specific data must be set up before calling this.
|
|
void spin_up_threaded_task(WorkerThreadTask task);
|
|
|
|
//This _must_ be called on the main thread BEFORE a task completes on a thread of the task pool.
|
|
void spin_down_threaded_task();
|
|
|
|
void init_task_pool();
|
|
void shut_down_task_pool();
|
|
|
|
bool is_threading();
|
|
size_t get_num_workers();
|
|
} |