21 | | === 1) int '''_sys_pthread_create'''( pthread_t* buffer , void* function ) === |
| 21 | === 1) int '''_sys_pthread_create'''( pthread_t * buffer , void * attr , void * function , void * arg ) === |
| 22 | This function search in the mapping a thread that is declared in the same space as the calling (parent) thread, |
| 23 | and has the entry point defined by the function <argument>. If it found a matching thread in the mapping, |
| 24 | this thread is activated. |
| 25 | * '''buffer''' : pointer on buffer to store the activated thread TRDID. |
| 26 | * '''attr''' : the attribute argument is not supported : must be NULL. |
| 27 | * '''function''' : pointer on the thread entry function. |
| 28 | * '''arg''' : pointer on function argument. |
| 29 | Returns 0 if success / returns -1 if matching thread not found. |
| 38 | |
| 39 | === 6) void '''_sys_kthread_create'''( unsigned int x , unsigned int y , unsigned int p , void * function , void * arg ) === |
| 40 | This function initializes a kernel thread context, for a core identified by the <x,y,p> arguments, in a given scheduler. |
| 41 | It allocate a new "ltid" and update the threads field in the scheduler. |
| 42 | It is used in kernel-init to create the NIC_TX and NIC_RX kernel threads. |
| 43 | * '''x''' : X cluster coordinate. |
| 44 | * '''y''' : Y cluster coordinate. |
| 45 | * '''p''' : local processor index in cluster. |
| 46 | * '''function''' : pointer on the thread entry function. |
| 47 | * '''arg''' : pointer on function argument. |