eal: new function to create control threads
[dpdk.git] / lib / librte_eal / common / include / rte_lcore.h
index c89e6ba..11f481c 100644 (file)
@@ -262,6 +262,26 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
  */
 int rte_thread_setname(pthread_t id, const char *name);
 
+/**
+ * Create a control thread.
+ *
+ * Wrapper to pthread_create().
+ *
+ * @param thread
+ *   Filled with the thread id of the new created thread.
+ * @param attr
+ *   Attributes for the new thread.
+ * @param start_routine
+ *   Function to be executed by the new thread.
+ * @param arg
+ *   Argument passed to start_routine.
+ * @return
+ *   On success, returns 0; on error, it returns a negative value
+ *   corresponding to the error number.
+ */
+int rte_ctrl_thread_create(pthread_t *thread, const pthread_attr_t *attr,
+                       void *(*start_routine)(void *), void *arg);
+
 /**
  * Test if the core supplied has a specific role
  *