18 #ifndef LIBCWD_PRIVATE_MUTEX_INSTANCES_H
19 #define LIBCWD_PRIVATE_MUTEX_INSTANCES_H
21 #if LIBCWD_THREAD_SAFE
24 #ifndef LIBCW_PTHREAD_H
25 #define LIBCW_PTHREAD_H
34 enum mutex_instance_nt {
37 object_files_instance,
42 location_cache_instance,
45 debug_objects_instance,
46 debug_channels_instance,
49 pthread_lock_interface_instance,
50 instance_rdlocked_size,
52 mutex_initialization_instance,
53 ids_singleton_tct_S_ids_instance,
55 alloc_tag_desc_instance,
56 list_allocations_instance,
61 write_max_len_instance,
63 kill_threads_instance,
66 reserved_instance_low,
67 reserved_instance_high = 3 * reserved_instance_low,
69 test_instance0 = reserved_instance_high,
76 #if CWDEBUG_DEBUG || CWDEBUG_DEBUGT
77 extern int instance_locked[instance_locked_size];
78 inline bool is_locked(
int instance) {
return instance_locked[instance] > 0; }
81 extern pthread_t locked_by[instance_locked_size];
82 extern void const* locked_from[instance_locked_size];
83 size_t const read_lock_offset = instance_locked_size;
84 size_t const high_priority_read_lock_offset = 2 * instance_locked_size;
90 #endif // LIBCWD_THREAD_SAFE
91 #endif // LIBCWD_PRIVATE_MUTEX_INSTANCES_H