Files
odfstudio/cppu
Stephan Bergmann a0bc388b38 Use the saner std::condition_variable semantics for JobQueue::m_cndWait
This avoids the need for the tricky osl::Condition::reset calls.  For example,
the first one (in the "disposed !" case) had been added with
2a3ed89284 "sb132: #i112448# proper clean up in
JobQueue::enter (patch by olistraub)" as

>                  if( 0 == m_lstCallstack.front() )
>                  {
>                      // disposed !
> +                    if( m_lstJob.empty() )
> +                    {
> +                        osl_resetCondition( m_cndWait );
> +                    }
>                      break;
>                  }
>

and then change to

>                  if( 0 == m_lstCallstack.front() )
>                  {
>                      // disposed !
> -                    if( m_lstJob.empty() )
> +                    if( m_lstJob.empty()
> +                        && (m_lstCallstack.empty()
> +                            || m_lstCallstack.front() != 0) )
>                      {
>                          osl_resetCondition( m_cndWait );
>                      }

with cba3ac1eab "Avoid deadlocks when disposing
recursive JobQueue::enter", which prevented the reset from ever hapening
(because m_lstCallstack.front() cannot both be zero and non-zero here at the
same time).  The std::condition_variable semantics nicely avoid any reasoning
whether or not a reset would be necessary here.

Change-Id: Ic9b57b836bb6679829f4aa3b68679256726acf60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96406
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-06-16 10:02:24 +02:00
..
…
2020-02-24 19:30:59 +01:00
…
…

Type definitions/implementations for the core of UNO. The exported API is in C.

See also:
[http://wiki.openoffice.org/wiki/Uno/Binary/Modules/CPPU]