This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__block id foo = [MyObject new]; | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
NSLog(@"block entering synchronized"); | |
@synchronized(foo) { | |
NSLog(@"running in synchronized"); | |
sleep(10); | |
// what does @synchronized do the now-zombie foo as part of its closure? | |
} | |
NSLog(@"block exited synchronized"); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// NOTE that responses are automatically generated by Presto (this example simulates the call as a demonstration) | |
// 1. Create new Response (faking $ctx) | |
$r = new Response((object) array( 'res' => 'htm' ) ); // htm intentional, tests type matching | |
// 2. Add a new type handler, with a custom mapping (anon fn) |