DosFreeSpinLock: Difference between revisions
Appearance
No edit summary |
|||
| Line 41: | Line 41: | ||
==Related Functions== | ==Related Functions== | ||
[[Category: | [[Category:Dos]] | ||
Revision as of 07:57, 19 July 2023
Free a subsystem spinlock
Syntax
APIRET APIENTRY DosFreeSpinLock (HSPINLOCK Handle)
Parameters
- Handle
- the spinlock handle returned from DosCreateSpinLock
Return Code
- NO_ERROR
- ERROR_INVALID_HANDLE
Remarks
DosFreeSpinLock frees a spinlock created by a call to 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);
}