source: vendor/current/source3/include/g_lock.h

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

File size: 2.0 KB
Line 
1/*
2 Unix SMB/CIFS implementation.
3 global locks based on dbwrap and messaging
4 Copyright (C) 2009 by Volker Lendecke
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef _G_LOCK_H_
21#define _G_LOCK_H_
22
23#include "dbwrap/dbwrap.h"
24
25struct g_lock_ctx;
26struct messaging_context;
27
28enum g_lock_type {
29 G_LOCK_READ = 0,
30 G_LOCK_WRITE = 1,
31};
32
33struct g_lock_ctx *g_lock_ctx_init(TALLOC_CTX *mem_ctx,
34 struct messaging_context *msg);
35
36struct tevent_req *g_lock_lock_send(TALLOC_CTX *mem_ctx,
37 struct tevent_context *ev,
38 struct g_lock_ctx *ctx,
39 const char *name,
40 enum g_lock_type type);
41NTSTATUS g_lock_lock_recv(struct tevent_req *req);
42NTSTATUS g_lock_lock(struct g_lock_ctx *ctx, const char *name,
43 enum g_lock_type lock_type, struct timeval timeout);
44NTSTATUS g_lock_unlock(struct g_lock_ctx *ctx, const char *name);
45NTSTATUS g_lock_get(struct g_lock_ctx *ctx, const char *name,
46 struct server_id *pid);
47
48NTSTATUS g_lock_do(const char *name, enum g_lock_type lock_type,
49 struct timeval timeout,
50 void (*fn)(void *private_data), void *private_data);
51
52int g_lock_locks(struct g_lock_ctx *ctx,
53 int (*fn)(const char *name, void *private_data),
54 void *private_data);
55NTSTATUS g_lock_dump(struct g_lock_ctx *ctx, const char *name,
56 int (*fn)(struct server_id pid,
57 enum g_lock_type lock_type,
58 void *private_data),
59 void *private_data);
60
61#endif
Note: See TracBrowser for help on using the repository browser.