ReactOS 0.4.16-dev-2104-gb84fa49
threaddll.c File Reference
#include <windows.h>
#include "threaddll.h"
Include dependency graph for threaddll.c:

Go to the source code of this file.

Functions

void CDECL _endthread (void)
 
void CDECL _endthreadex (unsigned int)
 
void WINAPI set_detach_event (HANDLE event)
 
static unsigned internal_thread_proc (void *param)
 
unsigned WINAPI stdcall_thread_proc (void *param)
 
void CDECL cdecl_thread_proc (void *param)
 
BOOL WINAPI DllMain (HINSTANCE instance_new, DWORD reason, LPVOID reserved)
 

Variables

static HANDLE detach_event
 

Function Documentation

◆ _endthread()

void CDECL _endthread ( void  )

Definition at line 73 of file thread.c.

74{
76
77 TRACE("(void)\n");
78
80 if (tls && tls->handle != INVALID_HANDLE_VALUE)
81 {
82 CloseHandle(tls->handle);
83 tls->handle = INVALID_HANDLE_VALUE;
84 } else
85 WARN("tls=%p tls->handle=%p\n", tls, tls ? tls->handle : INVALID_HANDLE_VALUE);
86
87 _endthreadex(0);
88}
#define WARN(fmt,...)
Definition: precomp.h:61
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1240
DWORD msvcrt_tls_index
Definition: main.c:29
void CDECL _endthreadex(unsigned int retval)
Definition: thread.c:93
static DWORD tls
Definition: sock.c:229
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by internal_thread_proc().

◆ _endthreadex()

void CDECL _endthreadex ( unsigned int  retval)

Definition at line 93 of file thread.c.

95{
96 TRACE("(%d)\n", retval);
97
98#if _MSVCR_VER >= 140
99 {
101
102 if (tls && tls->module != NULL)
104 else
105 WARN("tls=%p tls->module=%p\n", tls, tls ? tls->module : NULL);
106 }
107#endif
108
110}
#define NULL
Definition: types.h:112
VOID WINAPI FreeLibraryAndExitThread(HMODULE hLibModule, DWORD dwExitCode)
Definition: loader.c:507
VOID WINAPI ExitThread(IN DWORD uExitCode)
Definition: thread.c:365
int retval
Definition: wcstombs.cpp:91

Referenced by _beginthreadex_trampoline(), _endthread(), internal_thread_proc(), and thread_start().

◆ cdecl_thread_proc()

void CDECL cdecl_thread_proc ( void param)

Definition at line 56 of file threaddll.c.

57{
59}
GLfloat param
Definition: glext.h:5796
static unsigned internal_thread_proc(void *param)
Definition: threaddll.c:37

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  instance_new,
DWORD  reason,
LPVOID  reserved 
)

Definition at line 61 of file threaddll.c.

62{
63 switch (reason)
64 {
67 break;
68 }
69
70 return TRUE;
71}
#define TRUE
Definition: types.h:120
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
#define DLL_PROCESS_DETACH
Definition: compat.h:130
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
static HANDLE detach_event
Definition: threaddll.c:27

◆ internal_thread_proc()

static unsigned internal_thread_proc ( void param)
static

Definition at line 37 of file threaddll.c.

38{
39 struct threaddll_args *args = param;
40 SetEvent(args->confirm_running);
42
43 if (args->exit_method == thread_exit_endthread)
44 _endthread();
45 else if (args->exit_method == thread_exit_endthreadex)
46 _endthreadex(0);
47
48 return 0;
49}
#define INFINITE
Definition: serial.h:102
Definition: match.c:390
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
void CDECL _endthread(void)
Definition: thread.c:73
void CDECL _endthreadex(unsigned int)
Definition: thread.c:93
@ thread_exit_endthreadex
Definition: threaddll.h:22
@ thread_exit_endthread
Definition: threaddll.h:21

Referenced by cdecl_thread_proc(), and stdcall_thread_proc().

◆ set_detach_event()

void WINAPI set_detach_event ( HANDLE  event)

Definition at line 32 of file threaddll.c.

33{
35}
struct _cl_event * event
Definition: glext.h:7739

◆ stdcall_thread_proc()

unsigned WINAPI stdcall_thread_proc ( void param)

Definition at line 51 of file threaddll.c.

52{
54}

Variable Documentation

◆ detach_event