Changeset 737 for trunk/src/kernel32/KERNEL32.CPP
- Timestamp:
- Aug 29, 1999, 4:56:47 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/KERNEL32.CPP
r705 r737 1 /* $Id: KERNEL32.CPP,v 1.1 8 1999-08-26 12:55:34sandervl Exp $ */1 /* $Id: KERNEL32.CPP,v 1.19 1999-08-29 14:56:02 sandervl Exp $ */ 2 2 3 3 /* … … 173 173 //****************************************************************************** 174 174 //****************************************************************************** 175 LONG WIN32API InterlockedDecrement(LPLONG lplVal)176 {177 dprintf(("KERNEL32: InterlockedDecrement\n"));178 return(O32_InterlockedDecrement(lplVal));179 }180 //******************************************************************************181 //******************************************************************************182 LONG WIN32API InterlockedIncrement(LPLONG lplVal)183 {184 dprintf(("KERNEL32: InterlockedIncrement\n"));185 return(O32_InterlockedIncrement(lplVal));186 }187 //******************************************************************************188 //******************************************************************************189 LONG WIN32API InterlockedExchange( PLONG arg1, LONG arg2)190 {191 dprintf(("KERNEL32: InterlockedExchange\n"));192 return O32_InterlockedExchange(arg1, arg2);193 }194 195 196 /************************************************************************197 * InterlockedCompareExchange [KERNEL32.879]198 *199 * Atomically compares Destination and Comperand, and if found equal exchanges200 * the value of Destination with Exchange201 *202 * RETURNS203 * Prior value of value pointed to by Destination204 */205 PVOID WIN32API InterlockedCompareExchange(206 PVOID *Destination, /* Address of 32-bit value to exchange */207 PVOID Exchange, /* change value, 32 bits */208 PVOID Comperand /* value to compare, 32 bits */209 ) {210 PVOID ret;211 /* StopAllThreadsAndProcesses() */212 213 ret=*Destination;214 if(*Destination==Comperand) *Destination=Exchange;215 216 /* ResumeAllThreadsAndProcesses() */217 return ret;218 }219 220 /************************************************************************221 * InterlockedExchangeAdd [KERNEL32.880]222 *223 * Atomically adds Increment to Addend and returns the previous value of224 * Addend225 *226 * RETURNS227 * Prior value of value pointed to by cwAddendTarget228 */229 LONG WIN32API InterlockedExchangeAdd(230 PLONG Addend, /* Address of 32-bit value to exchange */231 LONG Increment /* Value to add */232 ) {233 LONG ret;234 /* StopAllThreadsAndProcesses() */235 236 ret = *Addend;237 *Addend += Increment;238 239 /* ResumeAllThreadsAndProcesses() */240 return ret;241 }242 243 244 175 //****************************************************************************** 245 176 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.