thread-safe loking queue