ReactOS 0.4.15-dev-5664-g3bf4ef6
tlsmthread.c File Reference
#include <stdlib.h>
#include <windef.h>
Include dependency graph for tlsmthread.c:

Go to the source code of this file.

Functions

int __mingwthr_key_dtor (DWORD key, void(*dtor)(void *))
 
int __mingwthr_remove_key_dtor (DWORD key)
 
int ___w64_mingwthr_remove_key_dtor (DWORD key)
 
int ___w64_mingwthr_add_key_dtor (DWORD key, void(*dtor)(void *))
 

Function Documentation

◆ ___w64_mingwthr_add_key_dtor()

int ___w64_mingwthr_add_key_dtor ( DWORD  key,
void(*)(void *)  dtor 
)

Definition at line 44 of file tlsthrd.c.

45{
47
48 if (__mingwthr_cs_init == 0)
49 return 0;
51 if (new_key == NULL)
52 return -1;
53
54 new_key->key = key;
55 new_key->dtor = dtor;
56
58
59 new_key->next = key_dtor_list;
61
63 return 0;
64}
#define NULL
Definition: types.h:112
static HCRYPTKEY new_key(HCRYPTPROV hProv, ALG_ID aiAlgid, DWORD dwFlags, CRYPTKEY **ppCryptKey)
Definition: rsaenh.c:794
#define calloc
Definition: rosglue.h:14
Definition: copy.c:22
static CRITICAL_SECTION __mingwthr_cs
Definition: tlsthrd.c:28
static volatile int __mingwthr_cs_init
Definition: tlsthrd.c:29
static __mingwthr_key_t volatile * key_dtor_list
Definition: tlsthrd.c:41
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by __mingwthr_key_dtor().

◆ ___w64_mingwthr_remove_key_dtor()

int ___w64_mingwthr_remove_key_dtor ( DWORD  key)

Definition at line 67 of file tlsthrd.c.

68{
69 __mingwthr_key_t volatile *prev_key;
70 __mingwthr_key_t volatile *cur_key;
71
72 if (__mingwthr_cs_init == 0)
73 return 0;
74
76
77 prev_key = NULL;
78 cur_key = key_dtor_list;
79
80 while (cur_key != NULL)
81 {
82 if ( cur_key->key == key)
83 {
84 if (prev_key == NULL)
85 key_dtor_list = cur_key->next;
86 else
87 prev_key->next = cur_key->next;
88
89 free ((void*)cur_key);
90 break;
91 }
92 prev_key = cur_key;
93 cur_key = cur_key->next;
94 }
95
97 return 0;
98}
#define free
Definition: debug_ros.c:5
__mingwthr_key_t volatile * next
Definition: tlsthrd.c:37
DWORD key
Definition: tlsthrd.c:35

Referenced by __mingwthr_remove_key_dtor().

◆ __mingwthr_key_dtor()

int __mingwthr_key_dtor ( DWORD  key,
void(*)(void *)  dtor 
)

This file has no copyright assigned and is placed in the Public Domain. This file is part of the w64 mingw-runtime package. No warranty is given; refer to the file DISCLAIMER.PD within this package.

Written by Kai Tietz kai.t.nosp@m.ietz.nosp@m.@onev.nosp@m.isio.nosp@m.n.com

Definition at line 28 of file tlsmthread.c.

29{
30 if (dtor)
31 {
32 return ___w64_mingwthr_add_key_dtor (key, dtor);
33 }
34 return 0;
35}
int ___w64_mingwthr_add_key_dtor(DWORD key, void(*dtor)(void *))
Definition: tlsthrd.c:44

◆ __mingwthr_remove_key_dtor()

int __mingwthr_remove_key_dtor ( DWORD  key)

Definition at line 22 of file tlsmthread.c.

23{
25}
int ___w64_mingwthr_remove_key_dtor(DWORD key)
Definition: tlsthrd.c:67