]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - rtems/gw/libs/load.h
Changed all (I think) files using CRLF to use LF.
[can-benchmark.git] / rtems / gw / libs / load.h
index b355c24133db54efb8302e4d7731b819ee09d1f8..b81b8c678e21dc3301a07276509cbca517577a32 100644 (file)
@@ -1,7 +1,35 @@
-#ifndef __CPU_LOAD_H_\r
-#define __CPU_LOAD_H_\r
-\r
-int start_thread_load();\r
-int end_thread_load();\r
-\r
-#endif
\ No newline at end of file
+/*
+* Implements simple producer/consumer thread pair to cause load on the CPU.
+* 
+* Used in benchmarking the CAN gateway.
+*
+* Co-opted from http://support.dce.felk.cvut.cz/pos/cv3/src/semaphore.html. 
+*/
+#ifndef __CPU_LOAD_H_
+#define __CPU_LOAD_H_
+
+
+/*
+* This function starts threads loading the CPU and creates associated semaphores. 
+* 
+* Has a guard to prevent starting again, before it was stopped.
+*
+* No error handling currently, only tries to report errors.
+*
+* 0 if successfull, 1 otherwise.
+*/
+int start_thread_load();
+
+/*
+* This function stops threads loading the CPU and destroys associated semaphores. 
+*
+* Has a guard against attempting to stop the threads if they are not running.
+* 
+* No error handling currently, only tries to report errors.
+*
+* 0 if successfull, 1 otherwise.
+*/
+int end_thread_load();
+
+#endif
+