Merge branch 'develop' of ssh://barant.com/git/ServerCore into develop

This commit is contained in:
Brad Arant committed 2022-02-14 07:12:45 -08:00
commit e28468d79d
9 files changed
+97 -48

No files matched your search

+20 -16
View File
@@ -4,6 +4,7 @@
namespace core {
Thread::Thread(EPoll &ePoll) : ePoll(ePoll) {}
Thread::Thread(EPoll &ePoll, ThreadScope *scope) : ePoll(ePoll) {}
Thread::~Thread() {}
@@ -45,25 +46,28 @@ namespace core {
while(1) {
if(ePoll.isStopping())
if(ePoll.isStopping())
break;
status = "WAITING";
int rc = epoll_wait(ePoll.getDescriptor(), events, 50, -1);
status = "RUNNING";
status = "WAITING";
int rc = epoll_wait(ePoll.getDescriptor(), events, 50, -1);
status = "RUNNING";
if(rc < 0) {
// TODO: Make log entry indicating status received and ignore for now.
} else if(rc == 0) {
break;
} else if(rc > 0) {
for(int ix = 0; ix < rc; ++ix) {
++count;
if(((Socket *)events[ix].data.ptr)->eventReceived(events[ix]))
ePoll.resetSocket((Socket *)events[ix].data.ptr);
}
}
}
if(rc < 0) {
// TODO: Make log entry indicating status received and ignore for now.
} else if(rc == 0) {
break;
} else if(rc > 0) {
for(int ix = 0; ix < rc; ++ix) {
++count;
if(((Socket *)events[ix].data.ptr)->eventReceived(events[ix])) {
ePoll.resetSocket((Socket *)events[ix].data.ptr);
} else {
delete (Socket *)events[ix].data.ptr;
}
}
}
}
coreutils::Log(coreutils::LOG_DEBUG_1) << "Thread ending with thread id " << threadId << ".";
}