Thread safety cleanup

Add attribute to mark function as thread safe so that
static analyzer does not erroneously emit a warning.