术语 | tlssetvalue |
释义 | TlsSetValue 语法: C++ BOOL WINAPI TlsSetValue( __in DWORD dwTlsIndex, __in_opt LPVOID lpTlsValue ); TlsSetValue功能 商店的值在调用线程的线程本地存储(TLS)为指定的索引TLS的插槽。过程的每一个线程都有每个TLS索引的老虎。 参数 dwTlsIndex [in] TLS的指数是由TlsAlloc函数分配。 lpTlsValue [中,可选] 的值存储在调用线程的TLS槽的索引。 返回值 如果函数成功,返回值为非零。 如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。 备注 TLS的指标通常是分配给TlsAlloc函数在程序或DLL初始化。 TLS索引后,分配,过程的每一个线程可以使用它来访问自己的TLS的该指数插槽。一个线程指定在一个调用TLS的指数TlsSetValue,存储在其插槽一个值。该线程在其后指定调用相同指数TlsGetValue,检索储值。 TlsSetValue实施作为首要目标的速度。函数执行最低参数验证和错误检查。特别是,它成功如果dwTlsIndex范围为0通过(TLS_MINIMUM_AVAILABLE - 1)。它是由程序员,以确保指数的有效,而且该线程调用TlsSetValue之前调用TlsGetValue。 实例 有关示例,请参阅使用线程本地存储或使用的动态线程本地存储链接库。 要求: 最低支持:client-Windows 2000专业版 最低支持server-Windows 2000服务器 HeaderWinbase.h(头文件:winuser.h) LibraryKernel32.lib DLLKernel32.dll 参见 进程和线程函数 线程本地存储 对TlsAlloc TlsFree TlsGetValue 如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com) 生成日期:2009年8月27日 ==英文原文==TlsSetValue Function Stores a value in the calling thread's thread local storage (TLS) slot for the specified TLS index. Each thread of a process has its own slot for each TLS index. Syntax C++ BOOL WINAPI TlsSetValue( __in DWORD dwTlsIndex, __in_opt LPVOID lpTlsValue ); Parameters dwTlsIndex [in] The TLS index that was allocated by the TlsAlloc function. lpTlsValue [in, optional] The value to be stored in the calling thread's TLS slot for the index. Return Value If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError . Remarks TLS indexes are typically allocated by the TlsAlloc function during process or DLL initialization. After a TLS index is allocated, each thread of the process can use it to access its own TLS slot for that index. A thread specifies a TLS index in a call to TlsSetValue, to store a value in its slot. The thread specifies the same index in a subsequent call to TlsGetValue , to retrieve the stored value. TlsSetValue was implemented with speed as the primary goal. The function performs minimal parameter validation and error checking. In particular, it succeeds if dwTlsIndex is in the range 0 through (TLS_MINIMUM_AVAILABLE – 1). It is up to the programmer to ensure that the index is valid and that the thread calls TlsSetValue before calling TlsGetValue. Examples For an example, see Using Thread Local Storage or Using Thread Local Storage in a Dynamic-Link Library . Requirements Minimum supported clientWindows 2000 Professional Minimum supported serverWindows 2000 Server HeaderWinbase.h (include Windows.h) LibraryKernel32.lib DLLKernel32.dll See Also Process and Thread Functions Thread Local Storage TlsAlloc TlsFree TlsGetValue Send comments about this topic to Microsoft Build date: 8/27/2009 ==原始网址==http://msdn.microsoft.com/en-us/library/ms686818(VS.85).aspx\n |
随便看 |
|
windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。