Skip to content

Commit

Permalink
Revert parallel testing SemaphoreNode changes (#3687)
Browse files Browse the repository at this point in the history
* Revert "Fix bug with SHM interoperability with previous versions (#3624)"

This reverts commit 44b1875.

* Refs #19167: Revert original changes to SemaphoreNode

Signed-off-by: Javier Santiago <javiersantiago@eprosima.com>

---------

Signed-off-by: Javier Santiago <javiersantiago@eprosima.com>
  • Loading branch information
jsan-rt authored Jul 11, 2023
1 parent e7720ca commit ac7a129
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions src/cpp/utils/shared_memory/RobustInterprocessCondition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,26 +207,11 @@ class RobustInterprocessCondition

private:

/*!
* @warning Changing this class means no communication with previous versions of SHM transport.
*/
struct SemaphoreNode
{
SemaphoreNode()
{
}

~SemaphoreNode()
{
sem.bi::interprocess_semaphore::~interprocess_semaphore();
}

union
{
bi::interprocess_semaphore sem;
};
uint32_t next {SemaphoreList::LIST_NULL};
uint32_t prev {SemaphoreList::LIST_NULL};
bi::interprocess_semaphore sem {0};
uint32_t next;
uint32_t prev;
};

static constexpr uint32_t MAX_LISTENERS = 512;
Expand All @@ -236,8 +221,8 @@ class RobustInterprocessCondition
{
private:

uint32_t head_ {LIST_NULL};
uint32_t tail_ {LIST_NULL};
uint32_t head_;
uint32_t tail_;

public:

Expand Down Expand Up @@ -358,7 +343,6 @@ class RobustInterprocessCondition
inline uint32_t enqueue_listener()
{
auto sem_index = list_free_.pop(semaphores_pool_);
new (&semaphores_pool_[sem_index].sem) bi::interprocess_semaphore(0);
list_listening_.push(sem_index, semaphores_pool_);
return sem_index;
}
Expand All @@ -367,7 +351,6 @@ class RobustInterprocessCondition
uint32_t sem_index)
{
list_listening_.remove(sem_index, semaphores_pool_);
(&semaphores_pool_[sem_index])->~SemaphoreNode();
list_free_.push(sem_index, semaphores_pool_);
}

Expand Down

0 comments on commit ac7a129

Please sign in to comment.