https://bugs.documentfoundation.org/show_bug.cgi?id=100085

Stephan Bergmann <sberg...@redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sberg...@redhat.com

--- Comment #1 from Stephan Bergmann <sberg...@redhat.com> ---
(In reply to jan iversen from comment #0)
> add a nice example in include/sal if possible - in a verbose comment - that
> includes the word 'sleep' of how to use the function

"the function" presumably referring to osl::Thread::wait
(include/osl/thread.hxx)

> 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 ;-)

(note that the above code in helpcompiler/source/HelpCompiler.cxx no longer
exists in that form ever since
<https://cgit.freedesktop.org/libreoffice/core/commit/?id=9e7447d39e356857ef5786b513e99cee79385247>
"tdf#84323: Make osl::Thread::wait more readable")

> 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 =)

both (sal/qa/osl/thread/test_thread.cxx, sd/qa/unit/misc-tests.cxx) done with
<https://cgit.freedesktop.org/libreoffice/core/commit/?id=9e7447d39e356857ef5786b513e99cee79385247>
"tdf#84323: Make osl::Thread::wait more readable" for quite some time now

> 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
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to