A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correctly deal with simcall returning a intrusive_ptr of nullptr
[simgrid.git]
/
src
/
simix
/
smx_synchro_private.h
diff --git
a/src/simix/smx_synchro_private.h
b/src/simix/smx_synchro_private.h
index
c4c5371
..
c263d25
100644
(file)
--- a/
src/simix/smx_synchro_private.h
+++ b/
src/simix/smx_synchro_private.h
@@
-12,12
+12,12
@@
namespace simgrid {
namespace simix {
namespace simgrid {
namespace simix {
-class XBT_PUBLIC() Mutex {
+class XBT_PUBLIC() Mutex
Impl
{
public:
public:
- Mutex();
- ~Mutex();
- Mutex
(Mutex
const&) = delete;
- Mutex
& operator=(Mutex
const&) = delete;
+ Mutex
Impl
();
+ ~Mutex
Impl
();
+ Mutex
Impl(MutexImpl
const&) = delete;
+ Mutex
Impl& operator=(MutexImpl
const&) = delete;
void lock(smx_actor_t issuer);
bool try_lock(smx_actor_t issuer);
void lock(smx_actor_t issuer);
bool try_lock(smx_actor_t issuer);
@@
-29,14
+29,13
@@
public:
xbt_swag_t sleeping = nullptr;
// boost::intrusive_ptr<Mutex> support:
xbt_swag_t sleeping = nullptr;
// boost::intrusive_ptr<Mutex> support:
- friend void intrusive_ptr_add_ref(Mutex* mutex)
+ friend void intrusive_ptr_add_ref(Mutex
Impl
* mutex)
{
// Atomic operation! Do not split in two instructions!
{
// Atomic operation! Do not split in two instructions!
- auto previous = (mutex->refcount_)++;
+
XBT_ATTRIB_UNUSED
auto previous = (mutex->refcount_)++;
xbt_assert(previous != 0);
xbt_assert(previous != 0);
- (void) previous;
}
}
- friend void intrusive_ptr_release(Mutex* mutex)
+ friend void intrusive_ptr_release(Mutex
Impl
* mutex)
{
// Atomic operation! Do not split in two instructions!
auto count = --(mutex->refcount_);
{
// Atomic operation! Do not split in two instructions!
auto count = --(mutex->refcount_);