- All component locks moved to memory
[public/netxms.git] / src / server / core / nms_locks.h
CommitLineData
b54b2b11
VK
1/*
2** NetXMS - Network Management System
3** Copyright (C) 2003, 2004 Victor Kirhenshtein
4**
5** This program is free software; you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation; either version 2 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program; if not, write to the Free Software
17** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18**
19** $module: nms_locks.h
20**
21**/
22
23#ifndef _nms_locks_h_
24#define _nms_locks_h_
25
54abbe0e 26
b4895bbe
VK
27#define UNLOCKED ((DWORD)0xFFFFFFFF)
28
29
b54b2b11
VK
30//
31// Component identifiers used for locking
32//
33
b4895bbe
VK
34#define CID_EPP 0
35#define CID_USER_DB 1
36#define CID_EVENT_DB 2
37#define CID_ACTION_DB 3
38#define CID_TRAP_CFG 4
b54b2b11 39
54abbe0e
VK
40
41//
42// Functions
43//
44
45#ifndef _NETXMS_DB_SCHEMA_
46
47BOOL InitLocks(DWORD *pdwIpAddr, char *pszInfo);
48BOOL LockComponent(DWORD dwId, DWORD dwLockBy, char *pszOwnerInfo, DWORD *pdwCurrentOwner, char *pszCurrentOwnerInfo);
49void UnlockComponent(DWORD dwId);
50void RemoveAllSessionLocks(DWORD dwSessionId);
b4895bbe 51void UnlockDB(void);
54abbe0e
VK
52
53#endif
54
b54b2b11 55#endif