Simple piece of GCD code:
#include "stdio.h"
#include <dispatch/dispatch.h>
#include <Block.h>
int main()
{
dispatch_queue_t dq;
dq = dispatch_queue_create("HelloWorld", NULL);
dispatch_block_t block = ^{printf("===========Hello world.\n");};
dispatch_async(dq,block);
dispatch_main();
return 0;
}
No comments:
Post a Comment