VSF Documented
SDL_thread.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_SDL2_TRHEAD_H__
19#define __VSF_SDL2_TRHEAD_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "../../vsf_sdl2_cfg.h"
24
25#if VSF_USE_SDL2 == ENABLED && VSF_USE_LINUX == ENABLED
26
27#include "kernel/vsf_kernel.h"
28#include "SDL_stdinc.h"
29
30#include "begin_code.h"
31
32#include <pthread.h>
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38/*============================ MACROS ========================================*/
39/*============================ MACROFIED FUNCTIONS ===========================*/
40/*============================ TYPES =========================================*/
41
42typedef int (*SDL_ThreadFunction)(void *data);
43
46typedef int SDL_TLSID;
47typedef struct SDL_Thread {
50 void *data;
51 char name[sizeof(uintptr_t)];
53
54/*============================ GLOBAL VARIABLES ==============================*/
55/*============================ LOCAL VARIABLES ===============================*/
56/*============================ PROTOTYPES ====================================*/
57
58extern SDL_Thread * SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data);
59extern SDL_Thread * SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data);
60extern const char * SDL_GetThreadName(SDL_Thread *thread);
61extern SDL_threadID SDL_ThreadID(void);
63extern int SDL_SetThreadPriority(SDL_ThreadPriority priority);
64extern void SDL_WaitThread(SDL_Thread * thread, int *status);
65extern void SDL_DetachThread(SDL_Thread * thread);
66extern SDL_TLSID SDL_TLSCreate(void);
67extern void * SDL_TLSGet(SDL_TLSID id);
68extern int SDL_TLSSet(SDL_TLSID id, const void *value, void (*destructor)(void*));
69extern void SDL_TLSCleanup(void);
70
71#ifdef __cplusplus
72}
73#endif
74#include "close_code.h"
75
76#endif // VSF_USE_SDL2
77#endif // __VSF_SDL2_TRHEAD_H__
78/* EOF */
void * SDL_TLSGet(SDL_TLSID id)
Definition vsf_sdl2_thread.c:113
void SDL_DetachThread(SDL_Thread *thread)
Definition vsf_sdl2_thread.c:103
SDL_threadID SDL_GetThreadID(SDL_Thread *thread)
Definition vsf_sdl2_thread.c:87
const char * SDL_GetThreadName(SDL_Thread *thread)
Definition vsf_sdl2_thread.c:77
SDL_TLSID SDL_TLSCreate(void)
Definition vsf_sdl2_thread.c:108
SDL_Thread * SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data)
Definition vsf_sdl2_thread.c:72
void SDL_TLSCleanup(void)
Definition vsf_sdl2_thread.c:129
pthread_t SDL_threadID
Definition SDL_thread.h:45
int SDL_SetThreadPriority(SDL_ThreadPriority priority)
Definition vsf_sdl2_thread.c:92
vsf_prio_t SDL_ThreadPriority
Definition SDL_thread.h:44
void SDL_WaitThread(SDL_Thread *thread, int *status)
Definition vsf_sdl2_thread.c:98
int SDL_TLSID
Definition SDL_thread.h:46
int SDL_TLSSet(SDL_TLSID id, const void *value, void(*destructor)(void *))
Definition vsf_sdl2_thread.c:118
int(* SDL_ThreadFunction)(void *data)
Definition SDL_thread.h:42
SDL_threadID SDL_ThreadID(void)
Definition vsf_sdl2_thread.c:82
SDL_Thread * SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const size_t stacksize, void *data)
Definition vsf_sdl2_thread.c:44
struct ieee80211_ext_chansw_ie data
Definition ieee80211.h:80
int pthread_t
Definition pthread.h:197
uint32_t uintptr_t
Definition stdint.h:38
Definition SDL_thread.h:47
char name[sizeof(uintptr_t)]
Definition SDL_thread.h:51
SDL_threadID thread
Definition SDL_thread.h:48
SDL_ThreadFunction entry
Definition SDL_thread.h:49
void * data
Definition SDL_thread.h:50
vk_av_control_value_t value
Definition vsf_audio.h:171
vsf_prio_t
Definition vsf_kernel_common.h:37
uint8_t status
Definition vsf_tgui.h:122