FreeRDP
Loading...
Searching...
No Matches
libwinpr/thread/thread.h
1
22#ifndef WINPR_THREAD_PRIVATE_H
23#define WINPR_THREAD_PRIVATE_H
24
25#ifndef _WIN32
26
27#include <pthread.h>
28
29#include <winpr/thread.h>
30
31#include "../handle/handle.h"
32#include "../synch/event.h"
33#include "apc.h"
34
35typedef void* (*pthread_start_routine)(void*);
36typedef struct winpr_APC_item WINPR_APC_ITEM;
37
38typedef struct
39{
40 WINPR_ALIGN64 pthread_mutex_t mux;
41 WINPR_ALIGN64 pthread_cond_t cond;
42 WINPR_ALIGN64 BOOL val;
44
46{
47 WINPR_HANDLE common;
48
49 WINPR_ALIGN64 BOOL started;
50 WINPR_ALIGN64 WINPR_EVENT_IMPL event;
51 WINPR_ALIGN64 BOOL mainProcess;
52 WINPR_ALIGN64 BOOL detached;
53 WINPR_ALIGN64 BOOL joined;
54 WINPR_ALIGN64 BOOL exited;
55 WINPR_ALIGN64 DWORD dwExitCode;
56 WINPR_ALIGN64 pthread_t thread;
57 WINPR_ALIGN64 size_t dwStackSize;
58 WINPR_ALIGN64 LPVOID lpParameter;
59 WINPR_ALIGN64 pthread_mutex_t mutex;
60 mux_condition_bundle isRunning;
61 mux_condition_bundle isCreated;
62 WINPR_ALIGN64 LPTHREAD_START_ROUTINE lpStartAddress;
63 WINPR_ALIGN64 LPSECURITY_ATTRIBUTES lpThreadAttributes;
64 WINPR_ALIGN64 APC_QUEUE apc;
65#if defined(WITH_DEBUG_THREADS)
66 WINPR_ALIGN64 void* create_stack;
67 WINPR_ALIGN64 void* exit_stack;
68#endif
69};
70
71WINPR_THREAD* winpr_GetCurrentThread(VOID);
72
73typedef struct
74{
75 WINPR_HANDLE common;
76
77 pid_t pid;
78 int status;
79 DWORD dwExitCode;
80 int fd;
82
83#endif
84
85#endif /* WINPR_THREAD_PRIVATE_H */