Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.
This repository was archived by the owner on Feb 15, 2022. It is now read-only.

EDT or Trident callback thread freezes #145

Description

@Sebast91

Freeze of EDT or Trident callback thread takes place in StateTransitionMultiTracker due to concurrent access on {@link StateTransitionMultiTracker#trackerMap} in implementation of methods {@link StateTransitionListener#onModelStateTransition(StateTransitionEvent)} and {@link StateTransitionListener#onFocusStateTransition(StateTransitionEvent)} in {@link StateTransitionMultiTracker#addTracker(Comparable, StateTransitionTracker)} method.

In StateTransitionTracker all events are not delegated to EDT:

        // notify listeners on focus state transition
        this.focusTimeline.addCallback(new TimelineCallbackAdapter() {
            @Override
            public void onTimelineStateChanged(TimelineState oldState,
                    TimelineState newState, float durationFraction,
                    float timelinePosition) {
                fireFocusStateTransitionEvent(oldState, newState);
            }
        });

How to fix: delegate the call to {@link StateTransitionTracker#fireFocusStateTransitionEvent(TimelineState, TimelineState)} in EDT:

        // notify listeners on focus state transition
        this.focusTimeline.addCallback(new TimelineCallbackAdapter() {
            @Override
            public void onTimelineStateChanged(TimelineState oldState,
                    TimelineState newState, float durationFraction,
                    float timelinePosition) {
                SwingUtilities.invokeLater(new Runnable() {
                    @Override
                    public void run() {
                        fireFocusStateTransitionEvent(oldState, newState);
                    }
            }
        });

Regards,
Sébastien Gollion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions