sema.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SEMA_H
00022 #define SEMA_H
00023
00024 struct critsect_s
00025 {
00026 const char *name;
00027 void *private;
00028 };
00029
00030 #define DEFINE_GLOBAL_LOCK(name) \
00031 struct critsect_s name = { #name, NULL }
00032 #define DEFINE_STATIC_LOCK(name) \
00033 static struct critsect_s name = { #name, NULL }
00034
00035 #define DECLARE_LOCK(name) \
00036 struct critsect_s name
00037 #define INIT_LOCK(a) \
00038 do \
00039 { \
00040 (a).name = #a; \
00041 (a).private = NULL; \
00042 } \
00043 while (0)
00044 #define DESTROY_LOCK(name) _gpgme_sema_cs_destroy (&(name))
00045
00046
00047 #define LOCK(name) \
00048 do \
00049 { \
00050 _gpgme_sema_cs_enter (&(name)); \
00051 } \
00052 while (0)
00053
00054 #define UNLOCK(name) \
00055 do \
00056 { \
00057 _gpgme_sema_cs_leave (&(name)); \
00058 } \
00059 while (0)
00060
00061 void _gpgme_sema_subsystem_init (void);
00062 void _gpgme_sema_cs_enter (struct critsect_s *s);
00063 void _gpgme_sema_cs_leave (struct critsect_s *s);
00064 void _gpgme_sema_cs_destroy (struct critsect_s *s);
00065
00066 #endif
This file is part of the documentation for libkdenetwork Library Version 3.3.2.