Implemented lock-based and lock-free queue