# [−][src]Function mynewt::kernel::os::task_init

    pub fn task_init(
        arg1: Out<os_task>,
        arg2: &Strn,
        arg3: os_task_func_t,
        arg4: Ptr,
        arg5: u8,
        arg6: os_time_t,
        arg7: Out<[os_stack_t]>,
        arg8: u16
    ) -> MynewtResult<()>

Initialize a task.

This function initializes the task structure pointed to by t, clearing and setting it's stack pointer, provides sane defaults and sets the task as ready to run, and inserts it into the operating system scheduler.

- `t`: The task to initialize
- `name`: The name of the task to initialize
- `func`: The task function to call
- `arg`: The argument to pass to this task function
- `prio`: The priority at which to run this task
- `sanity_itvl`: The time at which this task should check in with the sanity task. OS_WAIT_FOREVER means never check in here.
- `stack_bottom`: A pointer to the bottom of a task's stack
- `stack_size`: The overall size of the task's stack.

Return: 0 on success, non-zero on failure.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)