2 * Implements simple producer/consumer thread pair to cause load on the CPU.
\r
4 * Used in benchmarking the CAN gateway.
\r
6 * Co-opted from http://support.dce.felk.cvut.cz/pos/cv3/src/semaphore.html.
\r
8 #ifndef __CPU_LOAD_H_
\r
9 #define __CPU_LOAD_H_
\r
13 * This function starts threads loading the CPU and creates associated semaphores.
\r
15 * Has a guard to prevent starting again, before it was stopped.
\r
17 * No error handling currently, only tries to report errors.
\r
19 * 0 if successfull, 1 otherwise.
\r
21 int start_thread_load();
\r
24 * This function stops threads loading the CPU and destroys associated semaphores.
\r
26 * Has a guard against attempting to stop the threads if they are not running.
\r
28 * No error handling currently, only tries to report errors.
\r
30 * 0 if successfull, 1 otherwise.
\r
32 int end_thread_load();
\r