Skip to content

Commit 0e48d4a

Browse files
Remove the unused mutex in shm_monitor
Signed-off-by: Sumanth Nirmal <[email protected]>
1 parent a3f7118 commit 0e48d4a

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

src/core/ddsc/src/shm__monitor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ enum shm_monitor_states {
3939
/// @brief abstraction for monitoring the shared memory communication with an internal
4040
/// thread responsible for reacting on received data via shared memory
4141
struct shm_monitor {
42-
ddsrt_mutex_t m_lock;
4342
iox_listener_t m_listener;
44-
4543
//use this if we wait but want to wake up for some reason e.g. terminate
4644
iox_user_trigger_t m_wakeup_trigger;
4745
uint32_t m_state;

src/core/ddsc/src/shm_monitor.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ static void shm_subscriber_callback(iox_sub_t subscriber, void * context_data);
3232

3333
void shm_monitor_init(shm_monitor_t* monitor)
3434
{
35-
ddsrt_mutex_init(&monitor->m_lock);
36-
3735
// storage is ignored internally now but we cannot pass a nullptr
3836
iox_listener_storage_t s;
3937
monitor->m_listener = iox_listener_init(&s);
@@ -53,7 +51,6 @@ void shm_monitor_destroy(shm_monitor_t* monitor)
5351

5452
iox_listener_deinit(monitor->m_listener);
5553
iox_user_trigger_deinit(monitor->m_wakeup_trigger);
56-
ddsrt_mutex_destroy(&monitor->m_lock);
5754
}
5855

5956
dds_return_t shm_monitor_wake_and_disable(shm_monitor_t* monitor)
@@ -100,14 +97,12 @@ dds_return_t shm_monitor_attach_reader(shm_monitor_t* monitor, struct dds_reader
10097

10198
dds_return_t shm_monitor_detach_reader(shm_monitor_t* monitor, struct dds_reader* reader)
10299
{
103-
ddsrt_mutex_lock(&monitor->m_lock);
104100
// if the reader is attached
105101
if (reader->m_iox_sub_context.monitor != NULL && reader->m_iox_sub_context.parent_reader != NULL) {
106102
iox_listener_detach_subscriber_event(monitor->m_listener, reader->m_iox_sub, SubscriberEvent_DATA_RECEIVED);
107103
reader->m_iox_sub_context.monitor = NULL;
108104
reader->m_iox_sub_context.parent_reader = NULL;
109105
}
110-
ddsrt_mutex_unlock(&monitor->m_lock);
111106
return DDS_RETCODE_OK;
112107
}
113108

0 commit comments

Comments
 (0)