1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
--- source/threads/named_rw_lock.cpp.orig 2026-02-27 14:10:30 UTC
+++ source/threads/named_rw_lock.cpp
@@ -107,19 +107,19 @@ class NamedRWLock::Impl (public)
#if (defined(unix) || defined(__unix) || defined(__unix__) || defined(__APPLE__)) && !defined(__CYGWIN__)
if (_value.owner())
{
- _exclusive_wake = sem_open((this->name() + "_exclusive").c_str(), (O_CREAT | O_EXCL), 0666, 0);
+ _exclusive_wake = sem_open(("/" + this->name() + "_exclusive").c_str(), (O_CREAT | O_EXCL), 0666, 0);
if (_exclusive_wake == SEM_FAILED)
throwex SystemException("Failed to create an exclusive wake semaphore for the named read/write lock!");
- _shared_wake = sem_open((this->name() + "_shared").c_str(), (O_CREAT | O_EXCL), 0666, 0);
+ _shared_wake = sem_open(("/" + this->name() + "_shared").c_str(), (O_CREAT | O_EXCL), 0666, 0);
if (_shared_wake == SEM_FAILED)
throwex SystemException("Failed to create an shared wake semaphore for the named read/write lock!");
}
else
{
- _exclusive_wake = sem_open((this->name() + "_exclusive").c_str(), O_CREAT, 0666, 0);
+ _exclusive_wake = sem_open(("/" + this->name() + "_exclusive").c_str(), O_CREAT, 0666, 0);
if (_exclusive_wake == SEM_FAILED)
throwex SystemException("Failed to open an exclusive wake semaphore for the named read/write lock!");
- _shared_wake = sem_open((this->name() + "_shared").c_str(), O_CREAT, 0666, 0);
+ _shared_wake = sem_open(("/" + this->name() + "_shared").c_str(), O_CREAT, 0666, 0);
if (_shared_wake == SEM_FAILED)
throwex SystemException("Failed to open an shared wake semaphore for the named read/write lock!");
}
@@ -145,10 +145,10 @@ class NamedRWLock::Impl (public)
// Unlink the named semaphores (owner only)
if (_value.owner())
{
- result = sem_unlink((name() + "_exclusive").c_str());
+ result = sem_unlink(("/" + name() + "_exclusive").c_str());
if (result != 0)
fatality(SystemException("Failed to unlink an exclusive wake semaphore for the named read/write lock!"));
- result = sem_unlink((name() + "_shared").c_str());
+ result = sem_unlink(("/" + name() + "_shared").c_str());
if (result != 0)
fatality(SystemException("Failed to unlink an shared wake semaphore for the named read/write lock!"));
}
|