mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Add a CPU affinity set to the TCB if SMP is enable and use this CPU set as a mask for determining which CPUs the thread may run on. Add an affinity field to the attrributes to permit controlling which CPUs a pthread may run on. Implements pthread_att_setaffinity_np() and pthread_attr_getaffinity_np().
This commit is contained in:
@@ -178,6 +178,10 @@ struct pthread_attr_s
|
||||
uint8_t max_repl; /* Maximum pending replenishments */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
cpu_set_t affinity; /* Set of permitted CPUs for the thread */
|
||||
#endif
|
||||
|
||||
size_t stacksize; /* Size of the stack allocated for the pthread */
|
||||
|
||||
#ifdef CONFIG_SCHED_SPORADIC
|
||||
|
||||
Reference in New Issue
Block a user