DosFreeSpinLock: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
Free a | Free a spinlock for multiprocessor serialization. | ||
==Syntax== | ==Syntax== | ||
APIRET APIENTRY DosFreeSpinLock ([[HSPINLOCK]] Handle) | |||
APIRET DosFreeSpinLock ([[HSPINLOCK]] Handle) | |||
==Parameters== | ==Parameters== | ||
; Handle : | ;Handle ([[HSPINLOCK]]):A handle to a spinlock. This handle was returned on the DosCreateSpinLock api call. | ||
==Return Code== | ==Return Code== | ||
Line 13: | Line 12: | ||
==Remarks== | ==Remarks== | ||
DosFreeSpinLock | DosFreeSpinLock is passed the handle which was returned by DosCreateSpinLock. | ||
==Example Code== | ==Example Code== | ||
Line 41: | Line 40: | ||
==Related Functions== | ==Related Functions== | ||
*[[DosCreateSpinLock]] | |||
*[[DosAcquireSpinLock]] | |||
*[[DosReleaseSpinLock]] | |||
[[Category: | [[Category:Dos]] |
Latest revision as of 10:12, 19 July 2023
Free a spinlock for multiprocessor serialization.
Syntax
APIRET APIENTRY DosFreeSpinLock (HSPINLOCK Handle)
Parameters
- Handle (HSPINLOCK)
- A handle to a spinlock. This handle was returned on the DosCreateSpinLock api call.
Return Code
- NO_ERROR
- ERROR_INVALID_HANDLE
Remarks
DosFreeSpinLock is passed the handle which was returned by DosCreateSpinLock.
Example Code
#define INCL_DOSSPINLOCK #include <os2.h> HSPINLOCK hspin; thread1() { //acquire spinlock DosAcquireSpinLock(hspin); //do something that only takes a few microseconds ... //release spinlock DosReleaseSpinLock(hspin); } void main() { //create spinlock DosCreateSpinLock(&hspin); //do something ... //destroy spinlock DosFreeSpinLock(hspin); }