网站首页  词典首页

请输入您要查询的函数:

 

术语 interlockedexchange
释义 InterlockedExchange
语法:
C++
LONG __cdecl InterlockedExchange(
__inout LONG volatile *Target,
__in LONG Value
);
InterlockedExchange函数
设置一个32位变量为指定的值作为一个原子操作。
经营上的指针变量,使用InterlockedExchangePointer功能。
进行手术的64位变量,使用InterlockedExchange64功能。
参数
目标[ in , out ]
一个价值指针进行交换。该函数设置这个变量的值,并返回其以前的值。
值 [in]
的价值进行交换的价值指向的目标。
返回值
该函数返回的目标参数的初始值。
备注
在互锁功能提供了一个同步进入一个变量是由多个线程共享的简单机制。此函数是原子与其他方面的互锁函数的调用。
此功能是使用一个编译器的内在可能的情况下。有关详细信息,请参阅Winbase.h头文件和_InterlockedExchange。
这个函数生成一个完整的内存屏障(或栅栏),以确保内存操作才能完成。
英特尔森林小组:对于性能要求较高的应用程序,使用InterlockedExchangeAcquire代替。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
互锁变量访问
InterlockedCompareExchange
InterlockedExchange64
InterlockedExchangeAcquire
InterlockedExchangeAdd
InterlockedExchangePointer
同步功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==InterlockedExchange Function
Sets a 32-bit variable to the specified value as an atomic operation.
To operate on a pointer variable, use the InterlockedExchangePointer function.
To operate on a 64-bit variable, use the InterlockedExchange64 function.
Syntax
C++
LONG __cdecl InterlockedExchange(
__inout LONG volatile *Target,
__in LONG Value
);
Parameters
Target [in, out]
A pointer to the value to be exchanged. The function sets this variable to Value, and returns its prior value.
Value [in]
The value to be exchanged with the value pointed to by Target.
Return Value
The function returns the initial value of the Target parameter.
Remarks
The interlocked functions provide a simple mechanism for synchronizing access to a variable that is shared by multiple threads. This function is atomic with respect to calls to other interlocked functions.
This function is implemented using a compiler intrinsic where possible. For more information, see the Winbase.h header file and _InterlockedExchange .
This function generates a full memory barrier (or fence) to ensure that memory operations are completed in order.
Intel IPF: For performance-critical applications, use InterlockedExchangeAcquire instead.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
Interlocked Variable Access
InterlockedCompareExchange
InterlockedExchange64
InterlockedExchangeAcquire
InterlockedExchangeAdd
InterlockedExchangePointer
Synchronization Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms683590(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:20:44