15#include "arccore/base/ReferenceCounter.h"
17#include "arccore/base/NotSupportedException.h"
19#include "arccore/concurrency/ConcurrencyGlobal.h"
21#include "arccore/concurrency/NullThreadImplementation.h"
22#include "arccore/concurrency/SpinLock.h"
24#ifdef ARCCORE_HAS_GLIB
25#include "arccore/concurrency/GlibThreadImplementation.h"
36 NullThreadImplementation global_null_thread_implementation;
37 ReferenceCounter<IThreadImplementation> global_thread_implementation{ &global_null_thread_implementation };
43IThreadImplementation* Concurrency::
44getThreadImplementation()
46 return global_thread_implementation.get();
52IThreadImplementation* Concurrency::
53setThreadImplementation(IThreadImplementation* service)
55 IThreadImplementation* old_service = global_thread_implementation.get();
56 global_thread_implementation = service;
58 global_thread_implementation = &global_null_thread_implementation;
65Ref<IThreadImplementation> Concurrency::
66createGlibThreadImplementation()
68#ifdef ARCCORE_HAS_GLIB
69 return makeRef<IThreadImplementation>(
new GlibThreadImplementation());
71 throw NotSupportedException(A_FUNCINFO,
"GLib is not available Recompile Arccore with ARCCORE_ENABLE_GLIB=TRUE");
81 static Ref<IThreadImplementation> create()
87Ref<IThreadImplementation> Concurrency::
88createNullThreadImplementation()
90 return NullThreadImplementationFactory::create();
96void IThreadImplementation::
97_deprecatedCreateSpinLock(Int64* spin_lock_addr)
99 createSpinLock(spin_lock_addr);
105void IThreadImplementation::
106_deprecatedLockSpinLock(Int64* spin_lock_addr, Int64* scoped_spin_lock_addr)
108 lockSpinLock(spin_lock_addr, scoped_spin_lock_addr);
114void IThreadImplementation::
115_deprecatedUnlockSpinLock(Int64* spin_lock_addr, Int64* scoped_spin_lock_addr)
117 unlockSpinLock(spin_lock_addr, scoped_spin_lock_addr);
#define ARCCORE_DEFINE_REFERENCE_COUNTED_CLASS(class_name)
Macro pour définir les méthodes et types une classe qui utilise un compteur de référence.
Gestion des références à une classe C++.
Implémentation des threads en mode mono-thread.
Espace de nom de Arccore.