网站首页  词典首页

请输入您要查询的函数:

 

术语 interlockedcompareexchangepointer
释义 InterlockedCompareExchangePointer
语法:
C++
PVOID __cdecl InterlockedCompareExchangePointer(
__inout PVOID volatile *Destination,
__in PVOID Exchange,
__in PVOID Comparand
);
InterlockedCompareExchangePointer功能
执行一个原子的比较,并在指定的值交换操作。比较函数就比较的结果为基础的另一个指针值两个指定的指针值和交流。
经营非指针值,使用InterlockedCompareExchange功能。
参数
目的地[ in , out ]
如果一到目的地的价值指针的指针。
外汇 [in]
交换价值。
Comparand [in]
该值比较目的地。
返回值
该函数返回目的地参数的初始值。
备注
比较函数与Comparand价值目标的价值。如果目标的价值等于Comparand价值,交换价值都将保存在目的地指定的地址。否则,任何操作执行。
在64位系统,参数都是64位,必须对齐64位的边界,否则,该函数将unpredictably行为。在32位系统,参数是32位,必须在32位边界对齐。
在互锁功能提供了一个同步进入一个变量是由多个线程共享的简单机制。此函数是原子与其他方面的互锁函数的调用。
此功能是使用一个编译器的内在可能的情况下。有关详细信息,请参阅Winbase.h头文件和_InterlockedCompareExchangePointer。
这个函数生成一个完整的内存屏障(或栅栏),以确保内存操作才能完成。
英特尔森林小组:对于性能要求较高的应用程序,使用InterlockedCompareExchangePointerAcquire或InterlockedCompareExchangePointerRelease代替。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
参见
互锁变量访问
InterlockedCompareExchangePointerAcquire
InterlockedCompareExchangePointerRelease
InterlockedExchangePointer
同步功能
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==InterlockedCompareExchangePointer Function
Performs an atomic compare-and-exchange operation on the specified values. The function compares two specified pointer values and exchanges with another pointer value based on the outcome of the comparison.
To operate on non-pointer values, use the InterlockedCompareExchange function.
Syntax
C++
PVOID __cdecl InterlockedCompareExchangePointer(
__inout PVOID volatile *Destination,
__in PVOID Exchange,
__in PVOID Comparand
);
Parameters
Destination [in, out]
A pointer to a pointer to the destination value.
Exchange [in]
The exchange value.
Comparand [in]
The value to compare to Destination.
Return Value
The function returns the initial value of the Destination parameter.
Remarks
The function compares the Destination value with the Comparand value. If the Destination value is equal to the Comparand value, the Exchange value is stored in the address specified by Destination. Otherwise, no operation is performed.
On a 64-bit system, the parameters are 64 bits and must be aligned on 64-bit boundaries; otherwise, the function will behave unpredictably. On a 32-bit system, the parameters are 32 bits and must be aligned on 32-bit boundaries.
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 _InterlockedCompareExchangePointer .
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 InterlockedCompareExchangePointerAcquire or InterlockedCompareExchangePointerRelease instead.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
See Also
Interlocked Variable Access
InterlockedCompareExchangePointerAcquire
InterlockedCompareExchangePointerRelease
InterlockedExchangePointer
Synchronization Functions
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms683568(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 更新时间:2025/1/9 4:22:31