search for: dispatch_set_target_queu

Displaying 1 result from an estimated 1 matches for "dispatch_set_target_queu".

2015 Apr 08
2
[LLVMdev] __sync_add_and_fetch in objc block for global variable on ARM
...t damaged ... int32_t count = 0; ... int main(int argc, char *argv[]) {    for (i = 1; i < 32; ++i) {      ...         char* name;         asprintf(&name, "test.overcommit.%d", i);         dispatch_queue_t queue = dispatch_queue_create(name, NULL);         free(name);         dispatch_set_target_queue(queue, dispatch_get_global_queue(0,                     dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0)));         /* async queue */         dispatch_async(queue, ^{            __sync_add_and_fetch(&count, 1); //<< Here count is corrupted in case of number of threads> ~5   ...