mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-27 16:58:31 -04:00
zm::Select: Convert API to std::chrono
This commit is contained in:
1 parent
c823b9c00e
commit
3e8b10d813
5 files changed
+9
-24
No files matched your search
+2
-14
@@ -615,19 +615,7 @@ bool zm::TcpUnixServer::accept(TcpUnixSocket *&newSocket) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void zm::Select::setTimeout(int timeout) {
|
||||
mTimeout.tv_sec = timeout;
|
||||
mTimeout.tv_usec = 0;
|
||||
mHasTimeout = true;
|
||||
}
|
||||
|
||||
void zm::Select::setTimeout(double timeout) {
|
||||
mTimeout.tv_sec = int(timeout);
|
||||
mTimeout.tv_usec = suseconds_t((timeout - mTimeout.tv_sec) * 1000000.0);
|
||||
mHasTimeout = true;
|
||||
}
|
||||
|
||||
void zm::Select::setTimeout(timeval timeout) {
|
||||
void zm::Select::setTimeout(Microseconds timeout) {
|
||||
mTimeout = timeout;
|
||||
mHasTimeout = true;
|
||||
}
|
||||
@@ -703,7 +691,7 @@ void zm::Select::clearWriters() {
|
||||
}
|
||||
|
||||
int zm::Select::wait() {
|
||||
timeval tempTimeout = mTimeout;
|
||||
timeval tempTimeout = zm::chrono::duration_cast<timeval>(mTimeout);
|
||||
timeval *selectTimeout = mHasTimeout ? &tempTimeout : nullptr;
|
||||
|
||||
fd_set rfds;
|
||||
|
||||
Reference in new issue
Block a user