Skip to content

Commit 74aa833

Browse files
Merge pull request #1979 from arcaneframework/dev/gg-move-arccore-concurrency-in-namespace-arcane
Move types of component 'arccore/serialize' from namespace `Arccore` to namespace `Arcane`
2 parents efeec5c + 7c7239a commit 74aa833

16 files changed

+146
-94
lines changed

arccore/src/concurrency/arccore/concurrency/ConcurrencyGlobal.cc

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
22
//-----------------------------------------------------------------------------
3-
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
3+
// Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
44
// See the top-level COPYRIGHT file for details.
55
// SPDX-License-Identifier: Apache-2.0
66
//-----------------------------------------------------------------------------
77
/*---------------------------------------------------------------------------*/
8-
/* ConcurrencyGlobal.h (C) 2000-2024 */
8+
/* ConcurrencyGlobal.h (C) 2000-2025 */
99
/* */
1010
/* Définitions globales de la composante 'Concurrency' de 'Arccore'. */
1111
/*---------------------------------------------------------------------------*/
@@ -28,7 +28,7 @@
2828
/*---------------------------------------------------------------------------*/
2929
/*---------------------------------------------------------------------------*/
3030

31-
namespace Arccore
31+
namespace Arcane
3232
{
3333

3434
namespace
@@ -68,7 +68,7 @@ createGlibThreadImplementation()
6868
#ifdef ARCCORE_HAS_GLIB
6969
return makeRef<IThreadImplementation>(new GlibThreadImplementation());
7070
#else
71-
throw NotSupportedException(A_FUNCINFO,"GLib is not available Recompile Arccore with ARCCORE_ENABLE_GLIB=TRUE");
71+
throw NotSupportedException(A_FUNCINFO, "GLib is not available Recompile Arccore with ARCCORE_ENABLE_GLIB=TRUE");
7272
#endif
7373
}
7474

@@ -78,6 +78,7 @@ createGlibThreadImplementation()
7878
class NullThreadImplementationFactory
7979
{
8080
public:
81+
8182
static Ref<IThreadImplementation> create()
8283
{
8384
return makeRef<>(new NullThreadImplementation());
@@ -120,12 +121,15 @@ _deprecatedUnlockSpinLock(Int64* spin_lock_addr, Int64* scoped_spin_lock_addr)
120121
/*---------------------------------------------------------------------------*/
121122
/*---------------------------------------------------------------------------*/
122123

123-
ARCCORE_DEFINE_REFERENCE_COUNTED_CLASS(IThreadImplementation);
124+
} // namespace Arcane
124125

125126
/*---------------------------------------------------------------------------*/
126127
/*---------------------------------------------------------------------------*/
127128

128-
} // End namespace Arccore
129+
namespace Arccore
130+
{
131+
ARCCORE_DEFINE_REFERENCE_COUNTED_CLASS(Arcane::IThreadImplementation);
132+
}
129133

130134
/*---------------------------------------------------------------------------*/
131135
/*---------------------------------------------------------------------------*/

arccore/src/concurrency/arccore/concurrency/ConcurrencyGlobal.h

+34-15
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
/*---------------------------------------------------------------------------*/
3131
/*---------------------------------------------------------------------------*/
3232

33-
namespace Arccore
33+
namespace Arcane
3434
{
3535
class IThreadImplementation;
3636
class Mutex;
@@ -40,21 +40,26 @@ class IThreadBarrier;
4040
class NullThreadImplementation;
4141
class NullThreadBarrier;
4242

43+
//@{ Classe internes à Arccore/Arcane
44+
class SpinLockImpl;
45+
class GlibThreadImplementation;
46+
//@}
47+
4348
//! Classe opaque encapsulant l'implementation des threads
4449
class ThreadImpl;
4550
//! Classe opaque encapsulant l'implementation d'un mutex
4651
class MutexImpl;
47-
} // namespace Arccore
52+
} // namespace Arcane
4853

4954
/*---------------------------------------------------------------------------*/
5055
/*---------------------------------------------------------------------------*/
5156

52-
ARCCORE_DECLARE_REFERENCE_COUNTED_CLASS(IThreadImplementation)
57+
ARCCORE_DECLARE_REFERENCE_COUNTED_CLASS(Arcane::IThreadImplementation)
5358

5459
/*---------------------------------------------------------------------------*/
5560
/*---------------------------------------------------------------------------*/
5661

57-
namespace Arccore::Concurrency
62+
namespace Arcane::Concurrency
5863
{
5964

6065
/*---------------------------------------------------------------------------*/
@@ -80,26 +85,28 @@ createNullThreadImplementation();
8085
/*---------------------------------------------------------------------------*/
8186
/*---------------------------------------------------------------------------*/
8287

83-
} // namespace Arccore::Concurrency
88+
} // namespace Arcane::Concurrency
8489

8590
/*---------------------------------------------------------------------------*/
8691
/*---------------------------------------------------------------------------*/
8792

88-
namespace Arcane
93+
namespace Arccore
8994
{
9095

9196
/*---------------------------------------------------------------------------*/
9297
/*---------------------------------------------------------------------------*/
9398

94-
using Arccore::IThreadImplementation;
95-
using Arccore::Mutex;
96-
using Arccore::SpinLock;
97-
using Arccore::GlobalMutex;
98-
using Arccore::IThreadBarrier;
99-
using Arccore::ThreadImpl;
100-
using Arccore::MutexImpl;
101-
using Arccore::NullThreadImplementation;
102-
using Arccore::NullThreadBarrier;
99+
using Arcane::GlibThreadImplementation;
100+
using Arcane::GlobalMutex;
101+
using Arcane::IThreadBarrier;
102+
using Arcane::IThreadImplementation;
103+
using Arcane::Mutex;
104+
using Arcane::MutexImpl;
105+
using Arcane::NullThreadBarrier;
106+
using Arcane::NullThreadImplementation;
107+
using Arcane::SpinLock;
108+
using Arcane::SpinLockImpl;
109+
using Arcane::ThreadImpl;
103110

104111
/*---------------------------------------------------------------------------*/
105112
/*---------------------------------------------------------------------------*/
@@ -109,4 +116,16 @@ using Arccore::NullThreadBarrier;
109116
/*---------------------------------------------------------------------------*/
110117
/*---------------------------------------------------------------------------*/
111118

119+
namespace Arccore::Concurrency
120+
{
121+
using Arcane::Concurrency::getThreadImplementation;
122+
using Arcane::Concurrency::setThreadImplementation;
123+
using Arcane::Concurrency::createGlibThreadImplementation;
124+
using Arcane::Concurrency::createStdThreadImplementation;
125+
using Arcane::Concurrency::createNullThreadImplementation;
126+
}
127+
128+
/*---------------------------------------------------------------------------*/
129+
/*---------------------------------------------------------------------------*/
130+
112131
#endif

arccore/src/concurrency/arccore/concurrency/GlibAdapter.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
22
//-----------------------------------------------------------------------------
3-
// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
3+
// Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
44
// See the top-level COPYRIGHT file for details.
55
// SPDX-License-Identifier: Apache-2.0
66
//-----------------------------------------------------------------------------
77
/*---------------------------------------------------------------------------*/
8-
/* GlibAdapter.cc (C) 2000-2021 */
8+
/* GlibAdapter.cc (C) 2000-2025 */
99
/* */
1010
/* Classes utilitaires pour s'adapter aux différentes versions de la 'glib'. */
1111
/*---------------------------------------------------------------------------*/
@@ -28,7 +28,7 @@
2828
/*---------------------------------------------------------------------------*/
2929
/*---------------------------------------------------------------------------*/
3030

31-
namespace Arccore
31+
namespace Arcane
3232
{
3333

3434
/*---------------------------------------------------------------------------*/

arccore/src/concurrency/arccore/concurrency/GlibAdapter.h

+31-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
22
//-----------------------------------------------------------------------------
3-
// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
3+
// Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
44
// See the top-level COPYRIGHT file for details.
55
// SPDX-License-Identifier: Apache-2.0
66
//-----------------------------------------------------------------------------
77
/*---------------------------------------------------------------------------*/
8-
/* GlibAdapter.h (C) 2000-2018 */
8+
/* GlibAdapter.h (C) 2000-2025 */
99
/* */
1010
/* Classes utilitaires pour s'adapter aux différentes versions de la 'glib'. */
1111
/*---------------------------------------------------------------------------*/
@@ -19,7 +19,7 @@
1919
/*---------------------------------------------------------------------------*/
2020
/*---------------------------------------------------------------------------*/
2121

22-
namespace Arccore
22+
namespace Arcane
2323
{
2424

2525
class GlibCond;
@@ -33,28 +33,41 @@ class GlibCond;
3333
class ARCCORE_CONCURRENCY_EXPORT GlibMutex
3434
{
3535
friend class GlibCond;
36+
3637
public:
38+
3739
class Impl;
40+
3841
public:
42+
3943
class Lock
4044
{
4145
public:
46+
4247
Lock(GlibMutex& x);
4348
~Lock();
4449
Lock() = delete;
4550
Lock(const Lock&) = delete;
4651
void operator=(const Lock&) = delete;
52+
4753
private:
54+
4855
Impl* m_mutex;
4956
};
57+
5058
public:
59+
5160
GlibMutex() ARCCORE_NOEXCEPT;
5261
~GlibMutex();
62+
5363
public:
64+
5465
void lock();
5566
void unlock();
67+
5668
private:
57-
Impl* m_p;
69+
70+
Impl* m_p = nullptr;
5871
};
5972

6073
/*---------------------------------------------------------------------------*/
@@ -66,15 +79,20 @@ class ARCCORE_CONCURRENCY_EXPORT GlibMutex
6679
class ARCCORE_CONCURRENCY_EXPORT GlibPrivate
6780
{
6881
public:
82+
6983
class Impl;
84+
7085
public:
86+
7187
GlibPrivate();
7288
~GlibPrivate();
7389
void create();
7490
void setValue(void* value);
7591
void* getValue();
92+
7693
private:
77-
Impl* m_p;
94+
95+
Impl* m_p = nullptr;
7896
};
7997

8098
/*---------------------------------------------------------------------------*/
@@ -86,22 +104,27 @@ class ARCCORE_CONCURRENCY_EXPORT GlibPrivate
86104
class ARCCORE_CONCURRENCY_EXPORT GlibCond
87105
{
88106
public:
107+
89108
class Impl;
109+
90110
public:
111+
91112
GlibCond();
92113
~GlibCond();
93114
void broadcast();
94115
void wait(GlibMutex* mutex);
116+
95117
private:
96-
Impl* m_p;
118+
119+
Impl* m_p = nullptr;
97120
};
98121

99122
/*---------------------------------------------------------------------------*/
100123
/*---------------------------------------------------------------------------*/
101124

102-
} // End namespace Arccore
125+
} // namespace Arcane
103126

104127
/*---------------------------------------------------------------------------*/
105128
/*---------------------------------------------------------------------------*/
106129

107-
#endif
130+
#endif

arccore/src/concurrency/arccore/concurrency/GlibThreadImplementation.cc

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
22
//-----------------------------------------------------------------------------
3-
// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
3+
// Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
44
// See the top-level COPYRIGHT file for details.
55
// SPDX-License-Identifier: Apache-2.0
66
//-----------------------------------------------------------------------------
77
/*---------------------------------------------------------------------------*/
8-
/* GlibThreadImplementation.cc (C) 2000-2021 */
8+
/* GlibThreadImplementation.cc (C) 2000-2025 */
99
/* */
1010
/* Implémentation des threads utilisant la glib. */
1111
/*---------------------------------------------------------------------------*/
@@ -25,7 +25,7 @@
2525
/*---------------------------------------------------------------------------*/
2626
/*---------------------------------------------------------------------------*/
2727

28-
namespace Arccore
28+
namespace Arcane
2929
{
3030

3131
/*---------------------------------------------------------------------------*/
@@ -47,8 +47,11 @@ class GlibThreadBarrier
4747
public:
4848

4949
GlibThreadBarrier()
50-
: m_wait_mutex(nullptr), m_wait(nullptr), m_nb_thread(0)
51-
, m_current_reached(0) {}
50+
: m_wait_mutex(nullptr)
51+
, m_wait(nullptr)
52+
, m_nb_thread(0)
53+
, m_current_reached(0)
54+
{}
5255

5356
public:
5457

@@ -75,7 +78,7 @@ class GlibThreadBarrier
7578
m_wait_mutex->lock();
7679
++m_current_reached;
7780
//cout << "ADD BARRIER N=" << m_current_reached << '\n';
78-
if (m_current_reached==m_nb_thread){
81+
if (m_current_reached == m_nb_thread) {
7982
m_current_reached = 0;
8083
is_last = true;
8184
//cout << "BROADCAST BARRIER N=" << m_current_reached << '\n';
@@ -86,7 +89,9 @@ class GlibThreadBarrier
8689
m_wait_mutex->unlock();
8790
return is_last;
8891
}
92+
8993
private:
94+
9095
GlibMutex* m_wait_mutex;
9196
GlibCond* m_wait;
9297
Integer m_nb_thread;
@@ -129,7 +134,7 @@ initialize()
129134
ThreadImpl* GlibThreadImplementation::
130135
createThread(IFunctor* f)
131136
{
132-
return reinterpret_cast<ThreadImpl*>(g_thread_new(nullptr,&_GlibStartFunc,f));
137+
return reinterpret_cast<ThreadImpl*>(g_thread_new(nullptr, &_GlibStartFunc, f));
133138
}
134139

135140
void GlibThreadImplementation::
@@ -218,7 +223,7 @@ createBarrier()
218223
/*---------------------------------------------------------------------------*/
219224
/*---------------------------------------------------------------------------*/
220225

221-
} // End namespace Arccore
226+
} // namespace Arcane
222227

223228
/*---------------------------------------------------------------------------*/
224229
/*---------------------------------------------------------------------------*/

arccore/src/concurrency/arccore/concurrency/GlibThreadImplementation.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
22
//-----------------------------------------------------------------------------
3-
// Copyright 2000-2024 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
3+
// Copyright 2000-2025 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
44
// See the top-level COPYRIGHT file for details.
55
// SPDX-License-Identifier: Apache-2.0
66
//-----------------------------------------------------------------------------
77
/*---------------------------------------------------------------------------*/
8-
/* GlibThreadImplementation.h (C) 2000-2024 */
8+
/* GlibThreadImplementation.h (C) 2000-2025 */
99
/* */
1010
/* Implémentation de ITreadImplementation avec la 'Glib'. */
1111
/*---------------------------------------------------------------------------*/
@@ -23,7 +23,7 @@
2323
/*---------------------------------------------------------------------------*/
2424
/*---------------------------------------------------------------------------*/
2525

26-
namespace Arccore
26+
namespace Arcane
2727
{
2828

2929
/*---------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)