Skip to content

Commit

Permalink
Remove IceUtil::Mutex from Ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
externl committed Jan 17, 2024
1 parent 5a1faff commit 49c1c9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions ruby/src/IceRuby/ValueFactoryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ IceRuby::ValueFactoryManager::add(Ice::ValueFactoryFunc, const string&)
void
IceRuby::ValueFactoryManager::add(const Ice::ValueFactoryPtr& f, const string& id)
{
Lock lock(*this);
std::lock_guard lock(_mutex);

if(id.empty())
{
Expand Down Expand Up @@ -129,7 +129,7 @@ IceRuby::ValueFactoryManager::find(const string& id) const noexcept
Ice::ValueFactoryPtr
IceRuby::ValueFactoryManager::findCore(const string& id) const noexcept
{
Lock lock(*this);
std::lock_guard lock(_mutex);

if(id.empty())
{
Expand Down Expand Up @@ -176,7 +176,7 @@ IceRuby::ValueFactoryManager::findValueFactory(const string& id) const
void
IceRuby::ValueFactoryManager::mark()
{
Lock lock(*this);
std::lock_guard lock(_mutex);

for(FactoryMap::iterator p = _factories.begin(); p != _factories.end(); ++p)
{
Expand All @@ -196,7 +196,7 @@ IceRuby::ValueFactoryManager::markSelf()
volatile VALUE self;

{
Lock lock(*this);
std::lock_guard lock(_mutex);

self = _self;
}
Expand All @@ -219,7 +219,7 @@ IceRuby::ValueFactoryManager::destroy()
FactoryMap factories;

{
Lock lock(*this);
std::lock_guard lock(_mutex);
if(_self == Qnil)
{
//
Expand Down
4 changes: 3 additions & 1 deletion ruby/src/IceRuby/ValueFactoryManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class DefaultValueFactory : public Ice::ValueFactory
};
using DefaultValueFactoryPtr = std::shared_ptr<DefaultValueFactory>;

class ValueFactoryManager final : public Ice::ValueFactoryManager, public IceUtil::Mutex
class ValueFactoryManager final : public Ice::ValueFactoryManager
{
public:

Expand Down Expand Up @@ -88,6 +88,8 @@ class ValueFactoryManager final : public Ice::ValueFactoryManager, public IceUti
VALUE _self;
FactoryMap _factories;
DefaultValueFactoryPtr _defaultFactory;

mutable std::mutex _mutex;
};
using ValueFactoryManagerPtr = std::shared_ptr<ValueFactoryManager>;

Expand Down

0 comments on commit 49c1c9a

Please sign in to comment.