use mutex macros for websocket synchronization