Skip to content

EventDispatchContext compatibility with Threads ReadWriteMutex #12

Description

@LK-Simon

Problem

Event<T> stores its dispatch context using:

Threads::ReadWriteMutex<
    EventDispatchContext
>

ESPressio Threads 3.1 uses equality comparison as part of the default ReadWriteMutex<T> change-detection mechanism.

EventDispatchContext, however, does not currently provide equality semantics.

Consequently, template instantiation of the relevant ReadWriteMutex<EventDispatchContext> path can fail because the default comparator attempts to evaluate:

a == b

for two EventDispatchContext instances.

Expected behaviour

EventDispatchContext should be equality-comparable under the project's C++17 target.

Two dispatch contexts should be considered equal when all values describing the dispatch context are equal:

  • Origin
  • TransportMessageID
  • HopCount

This allows ReadWriteMutex<EventDispatchContext> to use its normal change-detection mechanism without requiring a special-case comparator or weakening the generic Threads implementation.

Compatibility

The fix should be entirely backward-compatible.

No Event dispatch, Event Transport, listener, Observer, Event Bridge, or runtime Serializable Event interfaces should require modification.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions