Add functions for safe multi-threaded operations on channels