Browse Source

Cleanup locking for OSC playback.

tags/non-daw-v1.2.0
Jonathan Moore Liles 13 years ago
parent
commit
338e66c759
3 changed files with 16 additions and 16 deletions
  1. +0
    -4
      timeline/src/OSC_Thread.C
  2. +12
    -8
      timeline/src/Timeline.C
  3. +4
    -4
      timeline/src/Track.C

+ 0
- 4
timeline/src/OSC_Thread.C View File

@@ -51,11 +51,7 @@ OSC_Thread::process ( void )
{ {
usleep( 100 * 1000 ); usleep( 100 * 1000 );
lock();

timeline->process_osc(); timeline->process_osc();

unlock();
} }
} }




+ 12
- 8
timeline/src/Timeline.C View File

@@ -1479,16 +1479,16 @@ Timeline::add_track ( Track *track )
{ {
DMESSAGE( "added new track to the timeline" ); DMESSAGE( "added new track to the timeline" );


engine->lock();
wrlock();


osc_thread->lock();
engine->lock();


tracks->add( track ); tracks->add( track );


osc_thread->unlock();

engine->unlock(); engine->unlock();


unlock();

/* FIXME: why is this necessary? doesn't the above add do DAMAGE_CHILD? */ /* FIXME: why is this necessary? doesn't the above add do DAMAGE_CHILD? */
redraw(); redraw();


@@ -1500,17 +1500,17 @@ Timeline::remove_track ( Track *track )
{ {
DMESSAGE( "removed track from the timeline" ); DMESSAGE( "removed track from the timeline" );


engine->lock();
wrlock();


osc_thread->lock();
engine->lock();


/* FIXME: what to do about track contents? */ /* FIXME: what to do about track contents? */
tracks->remove( track ); tracks->remove( track );


osc_thread->unlock();

engine->unlock(); engine->unlock();


unlock();

/* FIXME: why is this necessary? doesn't the above add do DAMAGE_CHILD? */ /* FIXME: why is this necessary? doesn't the above add do DAMAGE_CHILD? */
redraw(); redraw();
} }
@@ -1708,6 +1708,8 @@ Timeline::process_osc ( void )
{ {
THREAD_ASSERT( OSC ); THREAD_ASSERT( OSC );


rdlock();

/* reconnect OSC signals */ /* reconnect OSC signals */
for ( int i = tracks->children(); i-- ; ) for ( int i = tracks->children(); i-- ; )
{ {
@@ -1719,5 +1721,7 @@ Timeline::process_osc ( void )
c->process_osc(); c->process_osc();
} }
} }

unlock();
} }



+ 4
- 4
timeline/src/Track.C View File

@@ -582,16 +582,16 @@ Track::remove ( Control_Sequence *t )
if ( ! control ) if ( ! control )
return; return;


engine->lock();
timeline->wrlock();


timeline->osc_thread->lock();
engine->lock();


control->remove( t ); control->remove( t );


timeline->osc_thread->unlock();

engine->unlock(); engine->unlock();


timeline->unlock();

resize(); resize();
} }




Loading…
Cancel
Save