-
Notifications
You must be signed in to change notification settings - Fork 2
/
Mutex.pas
39 lines (30 loc) · 1.12 KB
/
Mutex.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{*****************************************************************}
{ }
{ Mutex }
{ for ARSSE }
{ }
{ Copyright (c) 2010 Gregor A. Cieslak (a.k.a. Shoozza) }
{ All rights reserved }
{ }
{ NOT free to distribute or modify }
{ }
{*****************************************************************}
unit Mutex;
interface
implementation
uses
// system libs
Windows,
// arsse units
VersionInfo;
var
mHandle: THandle;
initialization
mHandle := CreateMutex(Nil, True, PChar('ARSSEv' + VERSION + '.' +
VERSIONBUILD));
if GetLastError = ERROR_ALREADY_EXISTS then
Halt;
finalization
if mHandle <> 0 then
CloseHandle(mHandle);
end.