libtransistor
A userland library for the Nintendo Switch
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
thread.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #include<libtransistor/types.h>
13 #include<reent.h>
14 
15 typedef struct {
16  thread_h handle;
17  bool owns_stack;
18  void *stack_bottom;
19  size_t stack_size;
20  void (*entry)(void *arg);
21  void *arg;
22  struct _reent reent;
23  void *pthread;
24 } trn_thread_t;
25 
39  void (*entry)(void *arg),
40  void *arg,
41  uint32_t priority,
42  int32_t processor_id,
43  size_t stack_size,
44  void *stack_bottom);
45 
50 
60 
66 result_t trn_thread_join(trn_thread_t *thread, int64_t timeout);
67 
72 void trn_thread_destroy(trn_thread_t *thread);
73 
74 #ifdef __cplusplus
75 }
76 #endif
Various system types.
result_t trn_thread_cancel_synchronization(trn_thread_t *thread)
Cancels synchronization on a thread.
handle_t thread_h
Thread handle.
Definition: types.h:39
result_t trn_thread_join(trn_thread_t *thread, int64_t timeout)
Waits for the given thread to exit.
uint32_t result_t
Function result.
Definition: types.h:51
result_t trn_thread_start(trn_thread_t *thread)
Starts the given thread.
void trn_thread_destroy(trn_thread_t *thread)
Destroys a thread. It is the caller's responsibility to ensure that a living thread is not destroyed...
Definition: thread.h:15
result_t trn_thread_create(trn_thread_t *thread, void(*entry)(void *arg), void *arg, uint32_t priority, int32_t processor_id, size_t stack_size, void *stack_bottom)
Creates a new thread.