代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/npth 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 377c1b91e67af25613ccb72ee26449661cea8d8e Mon Sep 17 00:00:00 2001
From: NIIBE Yutaka <gniibe@fsij.org>
Date: Thu, 8 Nov 2018 13:26:41 +0900
Subject: [PATCH 12/18] w32: Use cast by uintptr_t for thread ID.
* w32/npth.c (npth_init): Cast with uintptr_t.
(npth_setname_np, npth_create, npth_self): Likewise.
--
In w32/npth.h, npth_t is unsigned long int type, which is 32-bit
for both of 32-bit machine and 64-bit machine.
We use TlsSetValue, TlsGetValue and CreateThread API to handle
thread ID, which uses void * type, which is 64-bit on 64-bit
machine.
Because the size is different on 64-bit machine, here, we use explicit
cast to integer type which has enough size to have pointer.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
---
w32/npth.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/w32/npth.c b/w32/npth.c
index 6ea6d19..41213c0 100644
--- a/w32/npth.c
+++ b/w32/npth.c
@@ -351,7 +351,7 @@ npth_init (void)
thread = thread_table[thread_id];
thread->handle = handle;
- if (! TlsSetValue(tls_index, (LPVOID) thread_id))
+ if (! TlsSetValue(tls_index, (LPVOID)(uintptr_t) thread_id))
return map_error (GetLastError());
LEAVE();
@@ -449,11 +449,11 @@ npth_setname_np (npth_t target_thread, const char *name)
static DWORD
thread_start (void *arg)
{
- npth_t thread_id = (npth_t) arg;
+ npth_t thread_id = (npth_t)(uintptr_t) arg;
npth_impl_t thread;
void *result;
- if (! TlsSetValue(tls_index, (LPVOID) thread_id))
+ if (! TlsSetValue(tls_index, (LPVOID)(uintptr_t) thread_id))
/* FIXME: There is not much we can do here. */
;
@@ -519,7 +519,7 @@ npth_create (npth_t *newthread, const npth_attr_t *user_attr,
handle = CreateThread (NULL, 0,
(LPTHREAD_START_ROUTINE)thread_start,
- (void *) thread_id, CREATE_SUSPENDED,
+ (void *)(uintptr_t) thread_id, CREATE_SUSPENDED,
NULL);
if (handle == NULL)
{
@@ -556,7 +556,7 @@ npth_self (void)
if (thread_id == 0 && GetLastError() != ERROR_SUCCESS)
/* FIXME: Log the error. */
;
- return (npth_t) thread_id;
+ return (npth_t)(uintptr_t) thread_id;
}
--
1.8.3.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。