<commit_before>---
title: 扒了扒libdispatch源码
date: 2017-02-21 15:47:10

categories:
- Objective-C

tags:
- libdispatch
- GCD
---<commit_msg>update post<commit_after>---
title: 扒了扒libdispatch源码
date: 2017-02-21 15:47:10

categories:
- Objective-C

tags:
- libdispatch
- GCD
---

前几天扒了一下libdispatch的源码，当前最新的是 libdispatch-703.30.5.tar

``` c
void _dispatch_thread_event_wait_slow(dispatch_thread_event_t dte) {
    kern_return_t kr;
    do {
        kr = semaphore_wait(dte->dte_semaphore);
    } while (unlikely(kr == KERN_ABORTED));
    DISPATCH_SEMAPHORE_VERIFY_KR(kr);
    return;
}
```
{'fraction_non_alphanumeric': 0.13162393162393163, 'fraction_numerical': 0.05811965811965812, 'mean_word_length': 4.0085470085470085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1449223', 'n_tokens_mistral': 289, 'n_tokens_neox': 258, 'n_words': 39}