1 /*
2  * Read/Write lock functions for testing
3  *
4  * Copyright (C) 2010-2021, Joachim Metz <joachim.metz@gmail.com>
5  *
6  * Refer to AUTHORS for acknowledgements.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #if !defined( _QCOW_TEST_RWLOCK_H )
23 #define _QCOW_TEST_RWLOCK_H
24 
25 #include <common.h>
26 
27 #include "qcow_test_libqcow.h"
28 
29 #if defined( __cplusplus )
30 extern "C" {
31 #endif
32 
33 #if defined( LIBQCOW_HAVE_MULTI_THREAD_SUPPORT ) && defined( HAVE_GNU_DL_DLSYM ) && defined( __GNUC__ ) && !defined( __clang__ ) && !defined( __CYGWIN__ )
34 #define HAVE_QCOW_TEST_RWLOCK		1
35 #endif
36 
37 #if defined( HAVE_QCOW_TEST_RWLOCK )
38 
39 extern int qcow_test_pthread_rwlock_init_attempts_before_fail;
40 
41 extern int qcow_test_pthread_rwlock_destroy_attempts_before_fail;
42 
43 extern int qcow_test_pthread_rwlock_rdlock_attempts_before_fail;
44 
45 extern int qcow_test_pthread_rwlock_wrlock_attempts_before_fail;
46 
47 extern int qcow_test_pthread_rwlock_unlock_attempts_before_fail;
48 
49 #endif /* defined( HAVE_QCOW_TEST_RWLOCK ) */
50 
51 #if defined( __cplusplus )
52 }
53 #endif
54 
55 #endif /* !defined( _QCOW_TEST_RWLOCK_H ) */
56 
57