https://bugs.documentfoundation.org/show_bug.cgi?id=100085
Bug ID: 100085
Summary: Centralize sleep function in SAL, with test functions.
Product: LibreOffice
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: LibreOffice
Assignee: [email protected]
Reporter: [email protected]
add a nice example in include/sal if possible - in a verbose comment - that
includes the word 'sleep' of how to use the function
cd include/sal
git grep -i sleep
still no hits =)
Change local sleep functions to call central function:
git grep -i sleep
helpcompiler/source/HelpCompiler.cxx-static void impl_sleep( sal_uInt32 nSec )
helpcompiler/source/HelpCompiler.cxx-{
helpcompiler/source/HelpCompiler.cxx- TimeValue aTime;
helpcompiler/source/HelpCompiler.cxx- aTime.Seconds = nSec;
helpcompiler/source/HelpCompiler.cxx- aTime.Nanosec = 0;
helpcompiler/source/HelpCompiler.cxx-
helpcompiler/source/HelpCompiler.cxx: osl::Thread::wait( aTime );
helpcompiler/source/HelpCompiler.cxx-}
Which is another victim of this API ;-)
cleanup and clarify things like:
sal/qa/osl/thread/test_thread.cxx- // Give the spawned threads enough
time to terminate:
sal/qa/osl/thread/test_thread.cxx- TimeValue const twentySeconds = { 20,
0 };
sal/qa/osl/thread/test_thread.cxx: osl::Thread::wait(twentySeconds);
or:
sd/qa/unit/misc-tests.cxx- TimeValue aSleep(0, 100 * 1000000); // 100
msec
sd/qa/unit/misc-tests.cxx: osl::Thread::wait(aSleep);
Which could be much clearer with the chrono thing =)
Remark, the wait function in SAL should have a default value of 100 msec,
allowing it to be used for context switching.
--
You are receiving this mail because:
You are the assignee for the bug._______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs