<commit_before># SwiftSynchronized

SwiftSynchronized provides synchronized, a global public function that serves as a Swift-substitute for Objective-C's @synchronized directive takes two arguments:

  - lockToken: An Objective-C object to synchronize on.
  - action: A closure with a generic return type.

synchronized returns synchronously. For Void return type, simply don't return anything.

# Usage: Returning a value

    return synchronized(self) {
        return protectedProperty
    }

# Usage: Returning void
    synchronized(self) {
        protectedProperty = newValue
    }

# Installation

To install via Cocoapods:

    pod 'SwiftSynchronized'
    
Don't forget to

    import SwiftSynchronized
    
somewhere in your project. Or just add SwiftSynchronized.swift to your project.

# Caution
Unlike Objective-C's @synchronized, Swift synchronized does not handle exceptions
<commit_msg>Correct the spelling of CocoaPods in README<commit_after># SwiftSynchronized

SwiftSynchronized provides synchronized, a global public function that serves as a Swift-substitute for Objective-C's @synchronized directive takes two arguments:

  - lockToken: An Objective-C object to synchronize on.
  - action: A closure with a generic return type.

synchronized returns synchronously. For Void return type, simply don't return anything.

# Usage: Returning a value

    return synchronized(self) {
        return protectedProperty
    }

# Usage: Returning void
    synchronized(self) {
        protectedProperty = newValue
    }

# Installation

To install via CocoaPods:

    pod 'SwiftSynchronized'
    
Don't forget to

    import SwiftSynchronized
    
somewhere in your project. Or just add SwiftSynchronized.swift to your project.

# Caution
Unlike Objective-C's @synchronized, Swift synchronized does not handle exceptions

{'fraction_non_alphanumeric': 0.05131004366812227, 'fraction_numerical': 0.0, 'mean_word_length': 3.9142091152815013, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6552635', 'n_tokens_mistral': 528, 'n_tokens_neox': 474, 'n_words': 194}