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
4ecc6555
Kaydet (Commit)
4ecc6555
authored
Agu 28, 2017
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replace use of oslInterlockedCount with std::atomic in bridges
Change-Id: Iad47a01fd283345a2461eaaea50633bf840e5201
üst
52ffad9b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
37 additions
and
24 deletions
+37
-24
bridge.hxx
bridges/inc/bridge.hxx
+6
-2
cppinterfaceproxy.hxx
bridges/inc/cppinterfaceproxy.hxx
+6
-2
unointerfaceproxy.hxx
bridges/inc/unointerfaceproxy.hxx
+6
-2
bridge.cxx
bridges/source/cpp_uno/shared/bridge.cxx
+2
-3
cppinterfaceproxy.cxx
bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx
+2
-3
unointerfaceproxy.cxx
bridges/source/cpp_uno/shared/unointerfaceproxy.cxx
+2
-5
jni_bridge.cxx
bridges/source/jni_uno/jni_bridge.cxx
+2
-2
jni_bridge.h
bridges/source/jni_uno/jni_bridge.h
+6
-2
jni_uno2java.cxx
bridges/source/jni_uno/jni_uno2java.cxx
+5
-3
No files found.
bridges/inc/bridge.hxx
Dosyayı görüntüle @
4ecc6555
...
...
@@ -20,7 +20,11 @@
#ifndef INCLUDED_BRIDGES_INC_BRIDGE_HXX
#define INCLUDED_BRIDGES_INC_BRIDGE_HXX
#include "osl/interlck.h"
#include <sal/config.h>
#include <atomic>
#include <cstddef>
#include "sal/types.h"
#include "typelib/typedescription.h"
#include "uno/environment.h"
...
...
@@ -90,7 +94,7 @@ private:
Bridge
*
pBridge
;
};
oslInterlockedCount
nRef
;
std
::
atomic
<
std
::
size_t
>
nRef
;
uno_ExtEnvironment
*
pCppEnv
;
uno_ExtEnvironment
*
pUnoEnv
;
...
...
bridges/inc/cppinterfaceproxy.hxx
Dosyayı görüntüle @
4ecc6555
...
...
@@ -20,7 +20,11 @@
#ifndef INCLUDED_BRIDGES_INC_CPPINTERFACEPROXY_HXX
#define INCLUDED_BRIDGES_INC_CPPINTERFACEPROXY_HXX
#include "osl/interlck.h"
#include <sal/config.h>
#include <atomic>
#include <cstddef>
#include "rtl/ustring.hxx"
#include "sal/types.h"
#include "typelib/typedescription.h"
...
...
@@ -84,7 +88,7 @@ private:
static
com
::
sun
::
star
::
uno
::
XInterface
*
castProxyToInterface
(
CppInterfaceProxy
*
pProxy
);
oslInterlockedCount
nRef
;
std
::
atomic
<
std
::
size_t
>
nRef
;
Bridge
*
pBridge
;
// mapping information
...
...
bridges/inc/unointerfaceproxy.hxx
Dosyayı görüntüle @
4ecc6555
...
...
@@ -20,7 +20,11 @@
#ifndef INCLUDED_BRIDGES_INC_UNOINTERFACEPROXY_HXX
#define INCLUDED_BRIDGES_INC_UNOINTERFACEPROXY_HXX
#include "osl/interlck.h"
#include <sal/config.h>
#include <atomic>
#include <cstddef>
#include "rtl/ustring.hxx"
#include "sal/types.h"
#include "typelib/typedescription.h"
...
...
@@ -83,7 +87,7 @@ private:
~
UnoInterfaceProxy
();
oslInterlockedCount
nRef
;
std
::
atomic
<
std
::
size_t
>
nRef
;
Bridge
*
pBridge
;
// mapping information
...
...
bridges/source/cpp_uno/shared/bridge.cxx
Dosyayı görüntüle @
4ecc6555
...
...
@@ -24,7 +24,6 @@
#include "unointerfaceproxy.hxx"
#include "com/sun/star/uno/XInterface.hpp"
#include "osl/interlck.h"
#include "rtl/ustring.h"
#include "sal/types.h"
#include "typelib/typedescription.h"
...
...
@@ -151,7 +150,7 @@ uno_Mapping * Bridge::createMapping(
void
Bridge
::
acquire
()
{
if
(
osl_atomic_increment
(
&
nRef
)
==
1
)
if
(
++
nRef
==
1
)
{
if
(
bExportCpp2Uno
)
{
...
...
@@ -172,7 +171,7 @@ void Bridge::acquire()
void
Bridge
::
release
()
{
if
(
!
osl_atomic_decrement
(
&
nRef
)
)
if
(
!
--
nRef
)
{
::
uno_revokeMapping
(
bExportCpp2Uno
?
&
aCpp2Uno
:
&
aUno2Cpp
);
}
...
...
bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx
Dosyayı görüntüle @
4ecc6555
...
...
@@ -26,7 +26,6 @@
#include "com/sun/star/uno/XInterface.hpp"
#include "osl/getglobalmutex.hxx"
#include "osl/interlck.h"
#include "osl/mutex.hxx"
#include "rtl/instance.hxx"
#include "typelib/typedescription.h"
...
...
@@ -120,7 +119,7 @@ com::sun::star::uno::XInterface * CppInterfaceProxy::create(
void
CppInterfaceProxy
::
acquireProxy
()
{
if
(
osl_atomic_increment
(
&
nRef
)
==
1
)
if
(
++
nRef
==
1
)
{
// rebirth of proxy zombie
// register at cpp env
...
...
@@ -134,7 +133,7 @@ void CppInterfaceProxy::acquireProxy()
void
CppInterfaceProxy
::
releaseProxy
()
{
if
(
!
osl_atomic_decrement
(
&
nRef
)
)
// last release
if
(
!
--
nRef
)
// last release
{
// revoke from cpp env
(
*
pBridge
->
getCppEnv
()
->
revokeInterface
)(
...
...
bridges/source/cpp_uno/shared/unointerfaceproxy.cxx
Dosyayı görüntüle @
4ecc6555
...
...
@@ -22,7 +22,6 @@
#include "bridge.hxx"
#include "com/sun/star/uno/XInterface.hpp"
#include "osl/interlck.h"
#include "typelib/typedescription.h"
#include "uno/dispatcher.h"
...
...
@@ -51,8 +50,7 @@ void freeUnoInterfaceProxy(uno_ExtEnvironment * pEnv, void * pProxy)
void
acquireProxy
(
uno_Interface
*
pUnoI
)
{
if
(
osl_atomic_increment
(
&
static_cast
<
UnoInterfaceProxy
*
>
(
pUnoI
)
->
nRef
)
==
1
)
if
(
++
static_cast
<
UnoInterfaceProxy
*
>
(
pUnoI
)
->
nRef
==
1
)
{
// rebirth of proxy zombie
// register at uno env
...
...
@@ -73,8 +71,7 @@ void acquireProxy(uno_Interface * pUnoI)
void
releaseProxy
(
uno_Interface
*
pUnoI
)
{
if
(
!
osl_atomic_decrement
(
&
static_cast
<
UnoInterfaceProxy
*
>
(
pUnoI
)
->
nRef
))
if
(
!
--
static_cast
<
UnoInterfaceProxy
*
>
(
pUnoI
)
->
nRef
)
{
// revoke from uno env on last release
(
*
static_cast
<
UnoInterfaceProxy
*
>
(
pUnoI
)
->
pBridge
->
getUnoEnv
()
->
...
...
bridges/source/jni_uno/jni_bridge.cxx
Dosyayı görüntüle @
4ecc6555
...
...
@@ -194,7 +194,7 @@ namespace jni_uno
void
Bridge
::
acquire
()
const
{
if
(
osl_atomic_increment
(
&
m_ref
)
==
1
)
if
(
++
m_ref
==
1
)
{
if
(
m_registered_java2uno
)
{
...
...
@@ -216,7 +216,7 @@ void Bridge::acquire() const
void
Bridge
::
release
()
const
{
if
(
!
osl_atomic_decrement
(
&
m_ref
)
)
if
(
!
--
m_ref
)
{
uno_revokeMapping
(
m_registered_java2uno
...
...
bridges/source/jni_uno/jni_bridge.h
Dosyayı görüntüle @
4ecc6555
...
...
@@ -20,11 +20,15 @@
#ifndef INCLUDED_BRIDGES_SOURCE_JNI_UNO_JNI_BRIDGE_H
#define INCLUDED_BRIDGES_SOURCE_JNI_UNO_JNI_BRIDGE_H
#include <sal/config.h>
#include <atomic>
#include <cstddef>
#include "jni_base.h"
#include "jni_helper.h"
#include "osl/diagnose.h"
#include "osl/interlck.h"
#include "uno/mapping.h"
#include "uno/dispatcher.h"
...
...
@@ -46,7 +50,7 @@ struct Mapping : public uno_Mapping
// Holds environments and mappings:
struct
Bridge
{
mutable
oslInterlockedCount
m_ref
;
mutable
std
::
atomic
<
std
::
size_t
>
m_ref
;
uno_ExtEnvironment
*
m_uno_env
;
uno_Environment
*
m_java_env
;
...
...
bridges/source/jni_uno/jni_uno2java.cxx
Dosyayı görüntüle @
4ecc6555
...
...
@@ -19,7 +19,9 @@
#include <sal/config.h>
#include <atomic>
#include <cassert>
#include <cstddef>
#include <memory>
#include <sal/alloca.h>
...
...
@@ -383,7 +385,7 @@ void Bridge::call_java(
// an UNO proxy wrapping a Java interface
struct
UNO_proxy
:
public
uno_Interface
{
mutable
oslInterlockedCount
m_ref
;
mutable
std
::
atomic
<
std
::
size_t
>
m_ref
;
Bridge
const
*
m_bridge
;
// mapping information
...
...
@@ -438,7 +440,7 @@ inline UNO_proxy::UNO_proxy(
inline
void
UNO_proxy
::
acquire
()
const
{
if
(
osl_atomic_increment
(
&
m_ref
)
==
1
)
if
(
++
m_ref
==
1
)
{
// rebirth of proxy zombie
void
*
that
=
const_cast
<
UNO_proxy
*
>
(
this
);
...
...
@@ -454,7 +456,7 @@ inline void UNO_proxy::acquire() const
inline
void
UNO_proxy
::
release
()
const
{
if
(
osl_atomic_decrement
(
&
m_ref
)
==
0
)
if
(
--
m_ref
==
0
)
{
// revoke from uno env on last release
(
*
m_bridge
->
m_uno_env
->
revokeInterface
)(
...
...
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