mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Replace SingleTimer with base::Timer.
This commit is contained in:
@@ -8,7 +8,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "core/utils.h"
|
||||
|
||||
#include "base/qthelp_url.h"
|
||||
#include "application.h"
|
||||
#include "base/timer.h"
|
||||
#include "base/concurrent_timer.h"
|
||||
#include "platform/platform_specific.h"
|
||||
|
||||
extern "C" {
|
||||
@@ -84,7 +85,7 @@ std::atomic<int> GlobalAtomicRequestId = 0;
|
||||
}
|
||||
|
||||
TimeId LocalUnixtime() {
|
||||
return (TimeId)time(NULL);
|
||||
return (TimeId)time(nullptr);
|
||||
}
|
||||
|
||||
void unixtimeInit() {
|
||||
@@ -173,24 +174,24 @@ namespace {
|
||||
int _ffmpegLockManager(void **mutex, AVLockOp op) {
|
||||
switch (op) {
|
||||
case AV_LOCK_CREATE: {
|
||||
Assert(*mutex == 0);
|
||||
Assert(*mutex == nullptr);
|
||||
*mutex = reinterpret_cast<void*>(new QMutex());
|
||||
} break;
|
||||
|
||||
case AV_LOCK_OBTAIN: {
|
||||
Assert(*mutex != 0);
|
||||
Assert(*mutex != nullptr);
|
||||
reinterpret_cast<QMutex*>(*mutex)->lock();
|
||||
} break;
|
||||
|
||||
case AV_LOCK_RELEASE: {
|
||||
Assert(*mutex != 0);
|
||||
Assert(*mutex != nullptr);
|
||||
reinterpret_cast<QMutex*>(*mutex)->unlock();
|
||||
}; break;
|
||||
|
||||
case AV_LOCK_DESTROY: {
|
||||
Assert(*mutex != 0);
|
||||
Assert(*mutex != nullptr);
|
||||
delete reinterpret_cast<QMutex*>(*mutex);
|
||||
*mutex = 0;
|
||||
*mutex = nullptr;
|
||||
} break;
|
||||
}
|
||||
return 0;
|
||||
@@ -428,7 +429,8 @@ namespace ThirdParty {
|
||||
|
||||
bool checkms() {
|
||||
if (crl::adjust_time()) {
|
||||
Sandbox::adjustSingleTimers();
|
||||
base::Timer::Adjust();
|
||||
base::ConcurrentTimerEnvironment::Adjust();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user