File: threading.h

package info (click to toggle)
freespace2 25.0.0~rc11%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 47,232 kB
  • sloc: cpp: 657,500; ansic: 22,305; sh: 293; python: 200; makefile: 198; xml: 181
file content (19 lines) | stat: -rw-r--r-- 518 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#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();
}