Skip to content

Commit 45873d9

Browse files
authored
ofxOscReceiver: win32 implementation: shadow posix changes (#7979)
1 parent 01bd8b1 commit 45873d9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

addons/ofxOsc/libs/oscpack/src/ip/win32/UdpSocket.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include <cstring> // for memset
4949
#include <stdexcept>
5050
#include <vector>
51+
#include <atomic>
5152

5253
#include "ip/UdpSocket.h" // usually I'd include the module header first
5354
// but this is causing conflicts with BCB4 due to
@@ -353,7 +354,7 @@ class SocketReceiveMultiplexer::Implementation{
353354
std::vector< std::pair< PacketListener*, UdpSocket* > > socketListeners_;
354355
std::vector< AttachedTimerListener > timerListeners_;
355356

356-
volatile bool break_;
357+
std::atomic<bool> break_ { false };
357358
HANDLE breakEvent_;
358359

359360
double GetCurrentTimeMs() const
@@ -418,8 +419,6 @@ class SocketReceiveMultiplexer::Implementation{
418419

419420
void Run()
420421
{
421-
break_ = false;
422-
423422
// prepare the window events which we use to wake up on incoming data
424423
// we use this instead of select() primarily to support the AsyncBreak()
425424
// mechanism.
@@ -508,6 +507,7 @@ class SocketReceiveMultiplexer::Implementation{
508507
unsigned long enableNonblocking = 0;
509508
ioctlsocket( i->second->impl_->Socket(), FIONBIO, &enableNonblocking ); // make the socket blocking again
510509
}
510+
break_ = false;
511511
}
512512

513513
void Break()

0 commit comments

Comments
 (0)