00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00018 #ifndef LIBCWD_PRIVATE_MUTEX_INSTANCES_H
00019 #define LIBCWD_PRIVATE_MUTEX_INSTANCES_H
00020
00021 #if LIBCWD_THREAD_SAFE
00022
00023 #if CWDEBUG_DEBUGT
00024 #ifndef LIBCW_PTHREAD_H
00025 #define LIBCW_PTHREAD_H
00026 #include <pthread.h>
00027 #endif
00028 #endif
00029
00030 namespace libcwd {
00031 namespace _private_ {
00032
00033
00034 enum mutex_instance_nt {
00035
00036 static_tsd_instance,
00037 object_files_instance,
00038 end_recursive_types,
00039
00040 #if CWDEBUG_ALLOC
00041 memblk_map_instance,
00042 location_cache_instance,
00043 #endif
00044 threadlist_instance,
00045 debug_objects_instance,
00046 debug_channels_instance,
00047 #if CWDEBUG_DEBUGT
00048 keypair_map_instance,
00049 pthread_lock_interface_instance,
00050 instance_rdlocked_size,
00051 #endif
00052 mutex_initialization_instance,
00053 ids_singleton_tct_S_ids_instance,
00054 #if CWDEBUG_ALLOC
00055 alloc_tag_desc_instance,
00056 list_allocations_instance,
00057 #endif
00058 dlopen_map_instance,
00059 dlclose_instance,
00060 write_max_len_instance,
00061 set_ostream_instance,
00062 kill_threads_instance,
00063 function_instance,
00064
00065 reserved_instance_low,
00066 reserved_instance_high = 3 * reserved_instance_low,
00067
00068 test_instance0 = reserved_instance_high,
00069 test_instance1,
00070 test_instance2,
00071 test_instance3,
00072 instance_locked_size
00073 };
00074
00075 #if CWDEBUG_DEBUG || CWDEBUG_DEBUGT
00076 extern int instance_locked[instance_locked_size];
00077 inline bool is_locked(int instance) { return instance_locked[instance] > 0; }
00078 #endif
00079 #if CWDEBUG_DEBUGT
00080 extern pthread_t locked_by[instance_locked_size];
00081 extern void const* locked_from[instance_locked_size];
00082 size_t const read_lock_offset = instance_locked_size;
00083 size_t const high_priority_read_lock_offset = 2 * instance_locked_size;
00084 #endif
00085
00086 }
00087 }
00088
00089 #endif // LIBCWD_THREAD_SAFE
00090 #endif // LIBCWD_PRIVATE_MUTEX_INSTANCES_H
00091