mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-27 16:20:24 +01:00
wgl: Remove needless if (1) { ... }.
Noticed by Craig Scott on https://gitlab.freedesktop.org/mesa/mesa/-/issues/4427#note_857876 Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Reviewed-by: Charmaine Lee <charmainel@vmware.com> Reviewed-by: Neha Bhende <bhenden@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22706>
This commit is contained in:
parent
9105e771af
commit
16f3e9cd76
1 changed files with 23 additions and 25 deletions
|
|
@ -74,35 +74,33 @@ stw_tls_init(void)
|
|||
* stw_tls_init_thread() call for it later on.
|
||||
*/
|
||||
#ifndef _GAMING_XBOX
|
||||
if (1) {
|
||||
DWORD dwCurrentProcessId = GetCurrentProcessId();
|
||||
DWORD dwCurrentThreadId = GetCurrentThreadId();
|
||||
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, dwCurrentProcessId);
|
||||
if (hSnapshot != INVALID_HANDLE_VALUE) {
|
||||
THREADENTRY32 te;
|
||||
te.dwSize = sizeof te;
|
||||
if (Thread32First(hSnapshot, &te)) {
|
||||
do {
|
||||
if (te.dwSize >= FIELD_OFFSET(THREADENTRY32, th32OwnerProcessID) +
|
||||
sizeof te.th32OwnerProcessID) {
|
||||
if (te.th32OwnerProcessID == dwCurrentProcessId) {
|
||||
if (te.th32ThreadID != dwCurrentThreadId) {
|
||||
struct stw_tls_data *data;
|
||||
data = stw_tls_data_create(te.th32ThreadID);
|
||||
if (data) {
|
||||
EnterCriticalSection(&g_mutex);
|
||||
data->next = g_pendingTlsData;
|
||||
g_pendingTlsData = data;
|
||||
LeaveCriticalSection(&g_mutex);
|
||||
}
|
||||
DWORD dwCurrentProcessId = GetCurrentProcessId();
|
||||
DWORD dwCurrentThreadId = GetCurrentThreadId();
|
||||
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, dwCurrentProcessId);
|
||||
if (hSnapshot != INVALID_HANDLE_VALUE) {
|
||||
THREADENTRY32 te;
|
||||
te.dwSize = sizeof te;
|
||||
if (Thread32First(hSnapshot, &te)) {
|
||||
do {
|
||||
if (te.dwSize >= FIELD_OFFSET(THREADENTRY32, th32OwnerProcessID) +
|
||||
sizeof te.th32OwnerProcessID) {
|
||||
if (te.th32OwnerProcessID == dwCurrentProcessId) {
|
||||
if (te.th32ThreadID != dwCurrentThreadId) {
|
||||
struct stw_tls_data *data;
|
||||
data = stw_tls_data_create(te.th32ThreadID);
|
||||
if (data) {
|
||||
EnterCriticalSection(&g_mutex);
|
||||
data->next = g_pendingTlsData;
|
||||
g_pendingTlsData = data;
|
||||
LeaveCriticalSection(&g_mutex);
|
||||
}
|
||||
}
|
||||
}
|
||||
te.dwSize = sizeof te;
|
||||
} while (Thread32Next(hSnapshot, &te));
|
||||
}
|
||||
CloseHandle(hSnapshot);
|
||||
}
|
||||
te.dwSize = sizeof te;
|
||||
} while (Thread32Next(hSnapshot, &te));
|
||||
}
|
||||
CloseHandle(hSnapshot);
|
||||
}
|
||||
#endif /* _GAMING_XBOX */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue