//(nbufs=3,fcomp=2,ncomp=1,fready=0,nready=1,fclient=1,nclient=1) <-- BUG starts here
// Should be:
//(nbufs=3,fcomp=0,ncomp=1,fready=0,nready=0,fclient=1,nclient=1)
bundle.client_release(client_buffer);
//(nbufs=3,fcomp=2,ncomp=1,fready=0,nready=2,fclient=2,nclient=0)
// Should be:
//(nbufs=3,fcomp=0,ncomp=1,fready=1,nready=1,fclient=2,nclient=0)
client_buffer = bundle.client_acquire(); // <- locks here if in buggy state
}
SwitchingBundle:: last_consumed can be used without ever being set, thus its initial value of zero can wrongly be used and lead to bogus behavior.
TEST_F( SwitchingBundle Test, compositor_ client_ interleaved) :SwitchingBundl e bundle(nbuffers, allocator, basic_properties);
{
int nbuffers = 3;
mc:
mg::Buffer* client_buffer = nullptr;
//( nbufs=3, fcomp=0, ncomp=0, fready= 0,nready= 0,fclient= 0,nclient= 0)
client_buffer = bundle. client_ acquire( );
//( nbufs=3, fcomp=0, ncomp=0, fready= 0,nready= 0,fclient= 0,nclient= 1)
bundle. client_ release( client_ buffer) ;
//( nbufs=3, fcomp=0, ncomp=0, fready= 0,nready= 1,fclient= 1,nclient= 0)
client_buffer = bundle. client_ acquire( );
//( nbufs=3, fcomp=0, ncomp=0, fready= 0,nready= 1,fclient= 1,nclient= 1)
bundle. compositor_ acquire( 0);
//( nbufs=3, fcomp=2, ncomp=1, fready= 0,nready= 1,fclient= 1,nclient= 1) <-- BUG starts here nbufs=3, fcomp=0, ncomp=1, fready= 0,nready= 0,fclient= 1,nclient= 1)
// Should be:
//(
bundle. client_ release( client_ buffer) ;
//( nbufs=3, fcomp=2, ncomp=1, fready= 0,nready= 2,fclient= 2,nclient= 0) nbufs=3, fcomp=0, ncomp=1, fready= 1,nready= 1,fclient= 2,nclient= 0)
// Should be:
//(
client_buffer = bundle. client_ acquire( ); // <- locks here if in buggy state
}
Merge proposal with fix will come shortly...