288 {
294
295
296 [scaffold dispatchMainTask:^{
297 [synchronizer registerView:1];
298 [synchronizer registerView:2];
299 [synchronizer beginResizeForView:1
301 notify:^{
302 }];
303 [synchronizer beginResizeForView:2
305 notify:^{
306 }];
307 }];
308 [scaffold joinMain];
309 EXPECT_FALSE([synchronizer isWaitingWhenMutexIsAvailable]);
310
311
312 [scaffold dispatchRenderTask:^{
313 [synchronizer performCommitForView:1
315 notify:^{
316 }];
317 [synchronizer performCommitForView:2
319 notify:^{
320 }];
321 }];
322 [scaffold joinRender];
323 EXPECT_FALSE([synchronizer isWaitingWhenMutexIsAvailable]);
324
325
326 [scaffold dispatchMainTask:^{
327 [synchronizer beginResizeForView:2
329 notify:^{
331 }];
332 }];
333 begunResizing->
Wait();
334 EXPECT_TRUE([synchronizer isWaitingWhenMutexIsAvailable]);
335
336
337 [scaffold dispatchRenderTask:^{
338 [synchronizer performCommitForView:1
340 notify:^{
341 }];
342 }];
343 [scaffold joinRender];
344 EXPECT_TRUE([synchronizer isWaitingWhenMutexIsAvailable]);
345
346
347 [scaffold dispatchRenderTask:^{
348 [synchronizer performCommitForView:1
350 notify:^{
351 }];
352 }];
353 [scaffold joinRender];
354 EXPECT_TRUE([synchronizer isWaitingWhenMutexIsAvailable]);
355
356
357 [scaffold dispatchRenderTask:^{
358 [synchronizer performCommitForView:1
360 notify:^{
361 }];
362 }];
363 [scaffold joinRender];
364 EXPECT_TRUE([synchronizer isWaitingWhenMutexIsAvailable]);
365
366
367 [scaffold dispatchRenderTask:^{
368 [synchronizer performCommitForView:2
370 notify:^{
371 }];
372 }];
373 [scaffold joinRender];
374 [scaffold joinMain];
375 EXPECT_FALSE([synchronizer isWaitingWhenMutexIsAvailable]);
376}