Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
b68640c4
Kaydet (Commit)
b68640c4
authored
Ara 19, 2011
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Prevent creation of new ORequestThreads during shutdown.
üst
71b63586
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
thread.cxx
cppu/source/threadpool/thread.cxx
+25
-0
thread.hxx
cppu/source/threadpool/thread.hxx
+2
-0
No files found.
cppu/source/threadpool/thread.cxx
Dosyayı görüntüle @
b68640c4
...
...
@@ -30,12 +30,22 @@
#include <osl/diagnose.h>
#include <uno/threadpool.h>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/XInterface.hpp>
#include <rtl/instance.hxx>
#include <rtl/ustring.h>
#include <rtl/ustring.hxx>
#include "thread.hxx"
#include "jobqueue.hxx"
#include "threadpool.hxx"
namespace
{
namespace
css
=
com
::
sun
::
star
;
}
using
namespace
osl
;
extern
"C"
{
...
...
@@ -53,6 +63,8 @@ void SAL_CALL cppu_requestThreadWorker( void *pVoid )
namespace
cppu_threadpool
{
// ----------------------------------------------------------------------------------
ThreadAdmin
::
ThreadAdmin
()
:
m_disposed
(
false
)
{}
ThreadAdmin
::~
ThreadAdmin
()
{
#if OSL_DEBUG_LEVEL > 1
...
...
@@ -66,6 +78,15 @@ namespace cppu_threadpool {
void
ThreadAdmin
::
add
(
ORequestThread
*
p
)
{
MutexGuard
aGuard
(
m_mutex
);
if
(
m_disposed
)
{
throw
css
::
lang
::
DisposedException
(
rtl
::
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"cppu_threadpool::ORequestThread created after"
" cppu_threadpool::ThreadAdmin has been disposed"
)),
css
::
uno
::
Reference
<
css
::
uno
::
XInterface
>
());
}
m_lst
.
push_back
(
p
);
}
...
...
@@ -79,6 +100,10 @@ namespace cppu_threadpool {
void
ThreadAdmin
::
join
()
{
{
MutexGuard
aGuard
(
m_mutex
);
m_disposed
=
true
;
}
ORequestThread
*
pCurrent
;
do
{
...
...
cppu/source/threadpool/thread.hxx
Dosyayı görüntüle @
b68640c4
...
...
@@ -74,6 +74,7 @@ namespace cppu_threadpool {
class
ThreadAdmin
{
public
:
ThreadAdmin
();
~
ThreadAdmin
();
static
ThreadAdminHolder
&
getInstance
();
void
add
(
ORequestThread
*
);
...
...
@@ -83,6 +84,7 @@ namespace cppu_threadpool {
private
:
::
osl
::
Mutex
m_mutex
;
::
std
::
list
<
ORequestThread
*
>
m_lst
;
bool
m_disposed
;
};
}
// end cppu_threadpool
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment