shm sub BUGFIX wait for urge lock
* @brief subscription SHM routines
*
* @copyright
- * Copyright (c) 2018 - 2022 Deutsche Telekom AG.
- * Copyright (c) 2018 - 2022 CESNET, z.s.p.o.
+ * Copyright (c) 2018 - 2023 Deutsche Telekom AG.
+ * Copyright (c) 2018 - 2023 CESNET, z.s.p.o.
*
* This source code is licensed under BSD 3-Clause License (the "License").
* You may not use this file except in compliance with the License.
@@ -398,11 +398,10 @@ sr_shmsub_notify_wait_wr(sr_sub_shm_t *sub_shm, sr_sub_event_t expected_ev, int
/* FAKE WRITE UNLOCK */
sub_shm->lock.writer = 0;
- /* wait until this event was processed and there are no readers or another writer
- * (just like write lock except do not set a waiting writer, needs to wait for everyone else, even writers) */
+ /* wait until this event was processed and there are no readers or another writer (just like a write lock) */
sr_time_get(&timeout_abs, timeout_ms);
ret = 0;
- while (!ret && (sub_shm->lock.readers[0] || /*sub_shm->lock.writer ||*/
+ while (!ret && (sub_shm->lock.readers[0] || sub_shm->lock.writer ||
(sub_shm->event && !SR_IS_NOTIFY_EVENT(sub_shm->event)))) {
/* COND WAIT */
ret = sr_cond_timedwait(&sub_shm->lock.cond, &sub_shm->lock.mutex, &timeout_abs);
