diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2023-02-28 01:09:13 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-03-15 20:48:31 +0200 |
commit | a0e3da2625a39f16e2b0cdf187b5a4fd65eed855 (patch) | |
tree | 70475e41ef97e2dd2e07522ea986c4573db83e3d /src/corelib/io/qlockfile.h | |
parent | 779bdf481ca208c20cfabd02d02d74175b0624b9 (diff) |
QLockFile: {set}StaleLockTime: use chrono first
This is similar to the tryLock() commit, making the chrono overloads the
main methods, this way the lock time isn't limited by the size of int,
but rather by std::chrono::milliseconds (which can be as up to int64_t).
Task-number: QTBUG-110059
Change-Id: I8d1652748b16be2154233f7db57ed485bcab62c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qlockfile.h')
-rw-r--r-- | src/corelib/io/qlockfile.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/corelib/io/qlockfile.h b/src/corelib/io/qlockfile.h index ccba93baa5..ecc26d137f 100644 --- a/src/corelib/io/qlockfile.h +++ b/src/corelib/io/qlockfile.h @@ -37,12 +37,8 @@ public: } #endif - void setStaleLockTime(std::chrono::milliseconds value) { setStaleLockTime(int(value.count())); } - - std::chrono::milliseconds staleLockTimeAsDuration() const - { - return std::chrono::milliseconds(staleLockTime()); - } + void setStaleLockTime(std::chrono::milliseconds value); + std::chrono::milliseconds staleLockTimeAsDuration() const; bool isLocked() const; bool getLockInfo(qint64 *pid, QString *hostname, QString *appname) const; |