summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2014-04-02 08:22:12 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2014-04-02 08:22:12 (GMT)
commit8945be288772dd0087122837b2b4432109180088 (patch)
treef9b50a30394144ac5298d505d65ef98f4567b046
parentcd1131e118f9881677b328f05673bf3e90ba3dfb (diff)
downloadtcl-8945be288772dd0087122837b2b4432109180088.zip
tcl-8945be288772dd0087122837b2b4432109180088.tar.gz
tcl-8945be288772dd0087122837b2b4432109180088.tar.bz2
Marked all communication variables which are set by notifier thread with "volatile".
-rw-r--r--win/tclWinSock.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 1b252e0..036f3b9 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -146,7 +146,7 @@ struct TcpState {
int watchEvents; /* OR'ed combination of FD_READ, FD_WRITE,
* FD_CLOSE, FD_ACCEPT and FD_CONNECT that
* indicate which events are interesting. */
- int readyEvents; /* OR'ed combination of FD_READ, FD_WRITE,
+ volatile int readyEvents; /* OR'ed combination of FD_READ, FD_WRITE,
* FD_CLOSE, FD_ACCEPT and FD_CONNECT that
* indicate which events have occurred.
* Set by notifier thread, access must be
@@ -155,7 +155,8 @@ struct TcpState {
* FD_CLOSE, FD_ACCEPT and FD_CONNECT that
* indicate which events are currently being
* selected. */
- int acceptEventCount; /* Count of the current number of FD_ACCEPTs
+ volatile int acceptEventCount;
+ /* Count of the current number of FD_ACCEPTs
* that have arrived and not yet processed.
* Set by notifier thread, access must be
* protected by semaphore */
@@ -173,7 +174,7 @@ struct TcpState {
struct addrinfo *myaddr; /* Iterator over myaddrlist. */
int status; /* Cache status of async socket. */
int cachedBlocking; /* Cache blocking mode of async socket. */
- int connectError; /* Async connect error set by notifier thread.
+ volatile int connectError; /* Async connect error set by notifier thread.
* Set by notifier thread, access must be
* protected by semaphore */
struct TcpState *nextPtr; /* The next socket on the per-thread socket