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
123c5934
Kaydet (Commit)
123c5934
authored
Şub 23, 2012
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Adapted GCThread to safer-to-use salhelper::Thread
üst
a342b3e3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
26 deletions
+27
-26
build.lst
pyuno/prj/build.lst
+1
-1
makefile.mk
pyuno/source/module/makefile.mk
+1
-0
pyuno_gc.cxx
pyuno/source/module/pyuno_gc.cxx
+25
-25
No files found.
pyuno/prj/build.lst
Dosyayı görüntüle @
123c5934
bgpu pyuno : stoc cpputools cppuhelper bridges tools PYTHON:python LIBXSLT:libxslt NULL
bgpu pyuno : s
alhelper s
toc cpputools cppuhelper bridges tools PYTHON:python LIBXSLT:libxslt NULL
pu pyuno usr1 - all br_mkout NULL
pu pyuno\zipcore nmake - all pu_zipcore NULL
pu pyuno\source\module nmake - all pu_module NULL
...
...
pyuno/source/module/makefile.mk
Dosyayı görüntüle @
123c5934
...
...
@@ -92,6 +92,7 @@ SHL1STDLIBS= \
$(CPPULIB)
\
$(CPPUHELPERLIB)
\
$(SALLIB)
\
$(SALHELPERLIB)
\
$(PYTHONLIB)
\
$(EXTRA_FRAMEWORK_FLAG)
...
...
pyuno/source/module/pyuno_gc.cxx
Dosyayı görüntüle @
123c5934
...
...
@@ -25,8 +25,14 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include <pyuno_impl.hxx>
#include <osl/thread.hxx>
#include "pyuno_impl.hxx"
#include "sal/config.h"
#include "rtl/ref.hxx"
#include "salhelper/thread.hxx"
namespace
pyuno
{
...
...
@@ -47,25 +53,25 @@ static bool isAfterUnloadOrPy_Finalize()
!
Py_IsInitialized
();
}
class
GCThread
:
public
::
osl
::
Thread
{
PyObject
*
mPyObject
;
PyInterpreterState
*
mPyInterpreter
;
GCThread
(
const
GCThread
&
);
// not implemented
GCThread
&
operator
=
(
const
GCThread
&
);
// not implemented
class
GCThread
:
public
salhelper
::
Thread
{
public
:
GCThread
(
PyInterpreterState
*
interpreter
,
PyObject
*
object
);
virtual
void
SAL_CALL
run
();
virtual
void
SAL_CALL
onTerminated
();
};
private
:
virtual
~
GCThread
()
{}
virtual
void
execute
();
PyObject
*
mPyObject
;
PyInterpreterState
*
mPyInterpreter
;
};
GCThread
::
GCThread
(
PyInterpreterState
*
interpreter
,
PyObject
*
object
)
:
mPyObject
(
object
),
mPyInterpreter
(
interpreter
)
Thread
(
"pyunoGCThread"
),
mPyObject
(
object
),
mPyInterpreter
(
interpreter
)
{}
void
GCThread
::
run
()
void
GCThread
::
execute
()
{
// otherwise we crash here, when main has been left already
if
(
isAfterUnloadOrPy_Finalize
()
)
...
...
@@ -95,12 +101,6 @@ void GCThread::run()
}
}
void
GCThread
::
onTerminated
()
{
delete
this
;
}
void
decreaseRefCount
(
PyInterpreterState
*
interpreter
,
PyObject
*
object
)
{
// otherwise we crash in the last after main ...
...
...
@@ -111,11 +111,11 @@ void decreaseRefCount( PyInterpreterState *interpreter, PyObject *object )
// to be a method, which tells, whether the global
// interpreter lock is held or not
// TODO: Look for a more efficient solution
osl
::
Thread
*
t
=
new
GCThread
(
interpreter
,
object
);
// don't call create() because Valgrind complains about invalid read in
// the rather bizarre GCThread::onTerminated; try a lame workaround:
t
->
createSuspended
();
t
->
resume
();
rtl
::
Reference
<
GCThread
>
(
new
GCThread
(
interpreter
,
object
))
->
launch
(
);
//TODO: a protocol is missing how to join with the launched thread
// before exit(3), to ensure the thread is no longer relying on any
// infrastructure while that infrastructure is being shut down in
// atexit handlers
}
}
...
...
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