BcastListener: Guard start() w/spinlock for races
This commit is contained in:
@@ -133,10 +133,15 @@ void BroadcastListener::start(void)
|
||||
* We should also set up a timer to check for devices that have gone
|
||||
* away.
|
||||
*/
|
||||
{
|
||||
smo::SpinLock::Guard lock(isListeningLock);
|
||||
|
||||
socket.open(boost::asio::ip::udp::v4());
|
||||
socket.bind(listeningEndpoint);
|
||||
|
||||
isListening = true;
|
||||
}
|
||||
|
||||
// Start the first async receive operation
|
||||
startReceive();
|
||||
std::cout << __func__ << ": BroadcastListener started on port "
|
||||
|
||||
Reference in New Issue
Block a user