Guardtime KSI c SDK
src
ksi
mutex.h
Go to the documentation of this file.
1
/*
2
* Copyright 2013-2018 Guardtime, Inc.
3
*
4
* This file is part of the Guardtime client SDK.
5
*
6
* Licensed under the Apache License, Version 2.0 (the "License").
7
* You may not use this file except in compliance with the License.
8
* You may obtain a copy of the License at
9
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES, CONDITIONS, OR OTHER LICENSES OF ANY KIND, either
13
* express or implied. See the License for the specific language governing
14
* permissions and limitations under the License.
15
* "Guardtime" and "KSI" are trademarks or registered trademarks of
16
* Guardtime, Inc., and no license to trademarks is granted; Guardtime
17
* reserves and retains all trademark rights.
18
*/
19
20
21
#ifndef MUTEX_H_
22
#define MUTEX_H_
23
24
#ifdef __cplusplus
25
extern
"C"
{
26
#endif
27
39
enum
KSI_Lock_en
{
40
KSI_MUTEX_GLOBALS
= 0,
41
KSI_MUTEX_TRANSPORT
,
42
KSI_MUTEX_HASHING
,
43
KSI_MUTEX_CRYPTO
,
44
__KSI_NUMBER_OF_LOCKS
45
};
46
47
enum
KSI_LockMode_en
{
48
KSI_LOCK_ON
= 0x01,
49
KSI_LOCK_OFF
= 0x02
50
};
55
int
KSI_LOCK_count
();
56
65
typedef
int (*
KSI_Lock_cb
)(
int
mode,
int
n,
const
char
*file,
int
line);
66
74
int
KSI_LOCK_setCallback
(
KSI_Lock_cb
cb);
75
81
int
KSI_LOCK_set
(
int
mode,
int
n,
const
char
*file,
int
line);
82
83
#define KSI_LOCK(n) KSI_LOCK_set(KSI_LOCK_ON, (n), __FILE__, __LINE__)
84
#define KSI_UNLOCK(n) KSI_LOCK_set(KSI_LOCK_OFF, (n), __FILE__, __LINE__)
85
88
#ifdef __cplusplus
89
}
90
#endif
91
92
#endif
/* MUTEX_H_ */
KSI_Lock_en
KSI_Lock_en
Definition:
mutex.h:39
KSI_MUTEX_TRANSPORT
Definition:
mutex.h:41
KSI_Lock_cb
int(* KSI_Lock_cb)(int mode, int n, const char *file, int line)
Definition:
mutex.h:65
KSI_LOCK_ON
Definition:
mutex.h:48
KSI_LOCK_set
int KSI_LOCK_set(int mode, int n, const char *file, int line)
KSI_MUTEX_HASHING
Definition:
mutex.h:42
KSI_LOCK_OFF
Definition:
mutex.h:49
KSI_LOCK_count
int KSI_LOCK_count()
KSI_LOCK_setCallback
int KSI_LOCK_setCallback(KSI_Lock_cb cb)
KSI_LockMode_en
KSI_LockMode_en
Definition:
mutex.h:47
KSI_MUTEX_GLOBALS
Definition:
mutex.h:40
KSI_MUTEX_CRYPTO
Definition:
mutex.h:43
__KSI_NUMBER_OF_LOCKS
Definition:
mutex.h:44
Generated by
1.8.15