#![allow(non_camel_case_types, non_upper_case_globals)]
use std::os::raw::{c_char, c_int, c_uint, c_ulong, c_void};
pub const __tsan_mutex_linker_init: c_uint = 1;
pub const __tsan_mutex_write_reentrant: c_uint = 2;
pub const __tsan_mutex_read_reentrant: c_uint = 4;
pub const __tsan_mutex_not_static: c_uint = 256;
pub const __tsan_mutex_read_lock: c_uint = 8;
pub const __tsan_mutex_try_lock: c_uint = 16;
pub const __tsan_mutex_try_lock_failed: c_uint = 32;
pub const __tsan_mutex_recursive_lock: c_uint = 64;
pub const __tsan_mutex_recursive_unlock: c_uint = 128;
pub const __tsan_mutex_try_read_lock: c_uint = 24;
pub const __tsan_mutex_try_read_lock_failed: c_uint = 56;
pub const __tsan_switch_to_fiber_no_sync: c_uint = 1;
extern "C" {
pub fn __tsan_acquire(addr: *mut c_void);
pub fn __tsan_release(addr: *mut c_void);
pub fn __tsan_mutex_create(addr: *mut c_void, flags: c_uint);
pub fn __tsan_mutex_destroy(addr: *mut c_void, flags: c_uint);
pub fn __tsan_mutex_pre_lock(addr: *mut c_void, flags: c_uint);
pub fn __tsan_mutex_post_lock(addr: *mut c_void, flags: c_uint, recursion: c_int);
pub fn __tsan_mutex_pre_unlock(addr: *mut c_void, flags: c_uint) -> c_int;
pub fn __tsan_mutex_post_unlock(addr: *mut c_void, flags: c_uint);
pub fn __tsan_mutex_pre_signal(addr: *mut c_void, flags: c_uint);
pub fn __tsan_mutex_post_signal(addr: *mut c_void, flags: c_uint);
pub fn __tsan_mutex_pre_divert(addr: *mut c_void, flags: c_uint);
pub fn __tsan_mutex_post_divert(addr: *mut c_void, flags: c_uint);
pub fn __tsan_check_no_mutexes_held();
pub fn __tsan_external_register_tag(object_type: *const c_char) -> *mut c_void;
pub fn __tsan_external_register_header(tag: *mut c_void, header: *const c_char);
pub fn __tsan_external_assign_tag(addr: *mut c_void, tag: *mut c_void);
pub fn __tsan_external_read(addr: *mut c_void, caller_pc: *mut c_void, tag: *mut c_void);
pub fn __tsan_external_write(addr: *mut c_void, caller_pc: *mut c_void, tag: *mut c_void);
pub fn __tsan_get_current_fiber() -> *mut c_void;
pub fn __tsan_create_fiber(flags: c_uint) -> *mut c_void;
pub fn __tsan_destroy_fiber(fiber: *mut c_void);
pub fn __tsan_switch_to_fiber(fiber: *mut c_void, flags: c_uint);
pub fn __tsan_set_fiber_name(fiber: *mut c_void, name: *const c_char);
pub fn __tsan_on_initialize();
pub fn __tsan_on_finalize(failed: c_int) -> c_int;
pub fn __tsan_flush_memory();
pub fn __tsan_default_options() -> *const c_char;
pub fn __tsan_default_suppressions() -> *const c_char;
pub fn __tsan_get_report_data(
report: *mut c_void,
description: *mut *const c_char,
count: *mut c_int,
stack_count: *mut c_int,
mop_count: *mut c_int,
loc_count: *mut c_int,
mutex_count: *mut c_int,
thread_count: *mut c_int,
unique_tid_count: *mut c_int,
sleep_trace: *mut *mut c_void,
trace_size: c_ulong,
) -> c_int;
pub fn __tsan_get_report_stack(
report: *mut c_void,
idx: c_ulong,
trace: *mut *mut c_void,
trace_size: c_ulong,
) -> c_int;
pub fn __tsan_get_report_mop(
report: *mut c_void,
idx: c_ulong,
tid: *mut c_int,
addr: *mut *mut c_void,
size: *mut c_int,
write: *mut c_int,
atomic: *mut c_int,
trace: *mut *mut c_void,
trace_size: c_ulong,
) -> c_int;
pub fn __tsan_get_report_loc(
report: *mut c_void,
idx: c_ulong,
type_: *mut *const c_char,
addr: *mut *mut c_void,
start: *mut *mut c_void,
size: *mut c_ulong,
tid: *mut c_int,
fd: *mut c_int,
suppressable: *mut c_int,
trace: *mut *mut c_void,
trace_size: c_ulong,
) -> c_int;
pub fn __tsan_get_report_mutex(
report: *mut c_void,
idx: c_ulong,
mutex_id: *mut u64,
addr: *mut *mut c_void,
destroyed: *mut c_int,
trace: *mut *mut c_void,
trace_size: c_ulong,
) -> c_int;
pub fn __tsan_get_report_thread(
report: *mut c_void,
idx: c_ulong,
tid: *mut c_int,
os_id: *mut u64,
running: *mut c_int,
name: *mut *const c_char,
parent_tid: *mut c_int,
trace: *mut *mut c_void,
trace_size: c_ulong,
) -> c_int;
pub fn __tsan_get_report_unique_tid(
report: *mut c_void,
idx: c_ulong,
tid: *mut c_int,
) -> c_int;
pub fn __tsan_get_current_report() -> *mut c_void;
}