`type lock````=`

`|` `Lock`
`|` `Unlock`
`|` `LockedIfTrue`
`|` `NoEffect`

``
`type thread````=`

`|` `BackgroundThread`
`|` `MainThread`
`|` `MainThreadIfTrue`
`|` `UnknownThread`

``
`type container_access````=`

`|` `ContainerRead`
`|` `ContainerWrite`

``
`val is_thread_utils_method : string ‑> InferIR.Typ.Procname.t ‑> bool`

return true if the given method name is a utility class for checking what thread we're on

`val get_lock : InferIR.Typ.Procname.t ‑> InferIR.HilExp.t list ‑> lock`

describe how this procedure behaves with respect to locking

`val get_thread : InferIR.Typ.Procname.t ‑> thread`

describe how this procedure behaves with respect to thread access

`val get_container_access : InferIR.Typ.Procname.t ‑> InferIR.Tenv.t ‑> container_access option`

return Some (access) if this procedure accesses the contents of a container (e.g., Map.get)

`val is_java_library : InferIR.Typ.Procname.t ‑> bool`

return true if this function is library code from the JDK core libraries or Android

`val is_builder_function : InferIR.Typ.Procname.t ‑> bool`
`val has_return_annot : (InferIR.Annot.Item.t ‑> bool) ‑> InferIR.Typ.Procname.t ‑> bool`
`val is_functional : InferIR.Typ.Procname.t ‑> bool`
`val acquires_ownership : InferIR.Typ.Procname.t ‑> InferIR.Tenv.t ‑> bool`
`val is_threadsafe_collection : InferIR.Typ.Procname.t ‑> InferIR.Tenv.t ‑> bool`
`val is_box : InferIR.Typ.Procname.t ‑> bool`

return true if the given procname boxes a primitive type into a reference type

`val is_thread_confined_method : InferIR.Tenv.t ‑> InferIR.Procdesc.t ‑> bool`

Methods in

- @ThreadConfined classes and methods annotated with
- @ThreadConfined are assumed to all run on the same thread. For the moment we won't warn on accesses resulting from use of such methods at all. In future we should account for races between these methods and methods from completely different classes that don't necessarily run on the same thread as the confined object.

`val runs_on_ui_thread : InferIR.Tenv.t ‑> InferIR.Procdesc.t ‑> string option`

We don't want to warn on methods that run on the UI thread because they should always be single-threaded. Assume that methods annotated with

- @UiThread ,
- @OnEvent ,
- @OnBind ,
- @OnMount ,
- @OnUnbind ,
- @OnUnmount always run on the UI thread. Also assume that any superclass marked
- @UiThread implies all methods are on UI thread. Return Some string explaining why this method is on the UI thread, else return None.

`val should_analyze_proc : InferIR.Procdesc.t ‑> InferIR.Tenv.t ‑> bool`

return true if we should compute a summary for the procedure. if this returns false, we won't analyze the procedure or report any warnings on it. note: in the future, we will want to analyze the procedures in all of these cases in order to find more bugs. this is just a temporary measure to avoid obvious false positives

`val get_current_class_and_threadsafe_superclasses : InferIR.Tenv.t ‑> InferIR.Typ.Procname.t ‑> (InferIR.Typ.name * InferIR.Typ.name list) option`
`val is_thread_safe_method : InferIR.Typ.Procname.t ‑> InferIR.Tenv.t ‑> bool`

returns true if method or overriden method in superclass is

- @ThreadSafe ,
- @ThreadSafe (enableChecks = true), or is defined as an alias of
- @ThreadSafe in a .inferconfig file.

`val is_marked_thread_safe : InferIR.Procdesc.t ‑> InferIR.Tenv.t ‑> bool`
`val should_report_on_proc : InferIR.Procdesc.t ‑> InferIR.Tenv.t ‑> bool`

return true if procedure is at an abstraction boundary or reporting has been explicitly requested via

- @ThreadSafe

`val may_block : InferIR.Tenv.t ‑> InferIR.Typ.Procname.t ‑> InferIR.HilExp.t list ‑> InferModules.StarvationDomain.Event.severity_t option`

is the method call potentially blocking, given the actuals passed?

`val is_synchronized_library_call : InferIR.Tenv.t ‑> InferIR.Typ.Procname.t ‑> bool`

does the method call lock-then-unlock the underlying object? legacy Java containers like Vector do this, and can interact with explicit locking