freeswitch plugin: Removed some unnecessary DEBUG statements
[collectd.git] / src / esl_threadmutex.h
1 /* 
2  * Cross Platform Thread/Mutex abstraction
3  * Copyright(C) 2007 Michael Jerris
4  *
5  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
6  * copies of the Software, and permit persons to whom the Software is
7  * furnished to do so.
8  *
9  * This work is provided under this license on an "as is" basis, without warranty of any kind,
10  * either expressed or implied, including, without limitation, warranties that the covered code
11  * is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire
12  * risk as to the quality and performance of the covered code is with you. Should any covered
13  * code prove defective in any respect, you (not the initial developer or any other contributor)
14  * assume the cost of any necessary servicing, repair or correction. This disclaimer of warranty
15  * constitutes an essential part of this license. No use of any covered code is authorized hereunder
16  * except under this disclaimer. 
17  *
18  */
19
20
21 #ifndef _ESL_THREADMUTEX_H
22 #define _ESL_THREADMUTEX_H
23
24 #include "esl.h"
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* defined(__cplusplus) */
29
30 typedef struct esl_mutex esl_mutex_t;
31 typedef struct esl_thread esl_thread_t;
32 typedef void *(*esl_thread_function_t) (esl_thread_t *, void *);
33
34 ESL_DECLARE(esl_status_t) esl_thread_create_detached(esl_thread_function_t func, void *data);
35 esl_status_t esl_thread_create_detached_ex(esl_thread_function_t func, void *data, size_t stack_size);
36 void esl_thread_override_default_stacksize(size_t size);
37 ESL_DECLARE(esl_status_t) esl_mutex_create(esl_mutex_t **mutex);
38 ESL_DECLARE(esl_status_t) esl_mutex_destroy(esl_mutex_t **mutex);
39 ESL_DECLARE(esl_status_t) esl_mutex_lock(esl_mutex_t *mutex);
40 ESL_DECLARE(esl_status_t) esl_mutex_trylock(esl_mutex_t *mutex);
41 ESL_DECLARE(esl_status_t) esl_mutex_unlock(esl_mutex_t *mutex);
42
43 #ifdef __cplusplus
44 }
45 #endif /* defined(__cplusplus) */
46
47 #endif /* defined(_ESL_THREADMUTEX_H) */
48
49 /* For Emacs:
50  * Local Variables:
51  * mode:c
52  * indent-tabs-mode:t
53  * tab-width:4
54  * c-basic-offset:4
55  * End:
56  * For VIM:
57  * vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
58  */