version 1.111.2.1, 2006/07/27 23:11:52
|
version 1.111.2.2, 2006/07/31 17:37:18
|
|
|
// unlocked will not result in an ArrayIndexOutOfBounds | // unlocked will not result in an ArrayIndexOutOfBounds |
// exception. | // exception. |
| |
autoEntryMutex.unlock(); |
_entry_mut.unlock(); |
o.enqueue(message); | o.enqueue(message); |
autoEntryMutex.lock(); |
_entry_mut.lock(); |
// After enqueue a message and the autoEntryMutex has been released and locked again, | // After enqueue a message and the autoEntryMutex has been released and locked again, |
// the array of _entries can be changed. The ArrayIterator has be reset with the original _entries. | // the array of _entries can be changed. The ArrayIterator has be reset with the original _entries. |
entries.reset(_entries); | entries.reset(_entries); |
|
|
*/ | */ |
maxSocketCurrentPass++; | maxSocketCurrentPass++; |
| |
autoEntryMutex.unlock(); |
_entry_mut.unlock(); |
| |
// | // |
// The first argument to select() is ignored on Windows and it is not | // The first argument to select() is ignored on Windows and it is not |
|
|
#else | #else |
int events = select(maxSocketCurrentPass, &fdread, NULL, NULL, &tv); | int events = select(maxSocketCurrentPass, &fdread, NULL, NULL, &tv); |
#endif | #endif |
autoEntryMutex.lock(); |
_entry_mut.lock(); |
// After enqueue a message and the autoEntryMutex has been released and locked again, | // After enqueue a message and the autoEntryMutex has been released and locked again, |
// the array of _entries can be changed. The ArrayIterator has be reset with the original _entries | // the array of _entries can be changed. The ArrayIterator has be reset with the original _entries |
entries.reset(_entries); | entries.reset(_entries); |
|
|
events |= SocketMessage::READ; | events |= SocketMessage::READ; |
Message *msg = new SocketMessage(entries[indx].socket, events); | Message *msg = new SocketMessage(entries[indx].socket, events); |
entries[indx]._status = _MonitorEntry::BUSY; | entries[indx]._status = _MonitorEntry::BUSY; |
autoEntryMutex.unlock(); |
_entry_mut.unlock(); |
q->enqueue(msg); | q->enqueue(msg); |
autoEntryMutex.lock(); |
_entry_mut.lock(); |
// After enqueue a message and the autoEntryMutex has been released and locked again, | // After enqueue a message and the autoEntryMutex has been released and locked again, |
// the array of entries can be changed. The ArrayIterator has be reset with the original _entries | // the array of entries can be changed. The ArrayIterator has be reset with the original _entries |
entries.reset(_entries); | entries.reset(_entries); |