mutek/thread.h header reference
[Kernel services module]

The source code of this header can be browsed online.

Description  

Kernel thread service

Members  

Type  

Function  

  • error_t thread_create(context_entry_t *entry, void *arg, const struct thread_attr_s *attr)

Macro  

Members detail  

#define MUTEK_THREAD_H_  

This macro is declared in mutek/thread.h source file, line 21.

#define THREAD_ATTR_INITIALIZER  

This macro is declared in mutek/thread.h source file, line 47.

Default initializer for struct thread_attr_s

struct thread_attr_s  

This struct is declared in mutek/thread.h source file, line 38.

Thread attributes for the thread_create function.

FieldDescription
size_t stack_size;Byte size of the thread stack
enum mem_scope_e scope;Memory allocation scope for the thread and associated stack
struct cpu_tree_s * cpu;Processor affinity or NULL

error_t thread_create(context_entry_t *entry, void *arg, const struct thread_attr_s *attr)  

this function creates a standalone scheduler context. This allocates the thread object and its stack then push the thread in the scheduler running queue.

The entry point function is called with the arg argument when the new thread is first scheduled.

Context data and stack are freed when the entry point function returns. There is no special function to call before entry point exit.

Parameter list:

  • entry: Entry point
  • arg: Entry point argument
  • attr: Thread attributes, may be NULL.

The return value is 0 when done, -ENOMEM if allocation failed.

This is available when CONFIG_MUTEK_THREAD is defined.

Valid XHTML 1.0 StrictGenerated by diaxen on Wed Oct 17 21:18:39 2018 using MkDoc