Add thread-safe stack lib