<commit_before>/*! @file GTKDispatchQueue.h
 *
 * Copyright (c) 2014, 2015, 2016
 *   <NAME> <<EMAIL>>
 *
 * All rights reserved.
 *
 * This file is part of GTKKit. It may be distributed under the terms of the
 * 2-clause BSD License, which can be found in the file COPYING.BSD included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU Lesser
 * General Public License, either version 2 or 3, which can be found in the
 * files COPYING.LGPL2 and COPYING.LGPL3, respectively, both also included in
 * the packaging of this file.
 */

#import <ObjFW/ObjFW.h>

#import "defines.h"

/*!
 * @brief A block of code to be run as a work item by a GTKDispatchQueue. Takes
 * no parameters, returns no value.
 */
typedef void (^DispatchWorkItem)();

/*!
 * @brief A class representing objects which dispatch work items (blocks) to
 * a pool of threads managed by the system.
 *
 * GTKDispatchQueue represents the public interface to multithreaded programming
 * in GTKKit. It allows you to run code in multiple threads, synchronously or
 * asynchronously, optionally repeating, with an optional delay in seconds.
 */
@interface GTKDispatchQueue: OFObject

/*!
 * @brief A string label applied to the queue.
 */
@property (nonnull, copy) OFString *label;

+ (nonnull instancetype)main;
+ (nonnull instancetype)background;
+ (nonnull instancetype)gtk;

/*!
 * @brief Create and return a new dispatch queue with its own thread.
 */
+ (nonnull GTKDispatchQueue *)queueWithLabel:(nonnull OFString *)label;

/*!
 * @brief Run a work item, waiting for it to complete before returning.
 */
- (void)sync:(_Nonnull DispatchWorkItem)block;<commit_msg>Documenting in GTKDispatchQueue.h<commit_after>/*! @file GTKDispatchQueue.h
 *
 * Copyright (c) 2014, 2015, 2016
 *   <NAME> <<EMAIL>>
 *
 * All rights reserved.
 *
 * This file is part of GTKKit. It may be distributed under the terms of the
 * 2-clause BSD License, which can be found in the file COPYING.BSD included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU Lesser
 * General Public License, either version 2 or 3, which can be found in the
 * files COPYING.LGPL2 and COPYING.LGPL3, respectively, both also included in
 * the packaging of this file.
 */

#import <ObjFW/ObjFW.h>

#import "defines.h"

/*!
 * @brief A block of code to be run as a work item by a GTKDispatchQueue. Takes
 * no parameters, returns no value.
 */
typedef void (^DispatchWorkItem)();

/*!
 * @brief A class representing objects which dispatch work items (blocks) to
 * a pool of threads managed by the system. GTKDispatchQueue is the public
 * interface to a class cluster implementing specific types of dispatch
 * queues; the public interfaces it defines are the only ones needed to use
 * any type of queue, and your code need not be aware of any specific subclass.
 *
 * GTKDispatchQueue represents the public interface to multithreaded programming
 * in GTKKit. It allows you to run code in multiple threads, synchronously or
 * asynchronously, optionally repeating, with an optional delay in seconds.
 */
@interface GTKDispatchQueue: OFObject

/*!
 * @brief A string label applied to the queue.
 */
@property (nonnull, copy) OFString *label;

+ (nonnull instancetype)main;
+ (nonnull instancetype)background;
+ (nonnull instancetype)gtk;

/*!
 * @brief Create and return a new dispatch queue with its own thread.
 */
+ (nonnull GTKDispatchQueue *)queueWithLabel:(nonnull OFString *)label;

/*!
 * @brief Run a work item, waiting for it to complete before returning.
 */
- (void)sync:(_Nonnull DispatchWorkItem)block;
{'fraction_non_alphanumeric': 0.08687311592217045, 'fraction_numerical': 0.009317621266100301, 'mean_word_length': 4.11921458625526, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5683637', 'n_tokens_mistral': 1080, 'n_tokens_neox': 1022, 'n_words': 475}