Skip to content

AbstractEvent::hasDelegates() is not thread-safe #1865

@obiltschnig

Description

@obiltschnig
bool hasDelegates() const 
{ 
    return !(_strategy.empty()); 
} 

vs.

bool empty() const 
{ 
    typename TMutex::ScopedLock lock(_mutex); 
    return _strategy.empty(); 
 }

hasDelegates() should simply call empty():

bool hasDelegates() const 
{ 
    return !empty(); 
} 

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions