//
//  GSSynchronizationHelpers.h
//  GlyphsKit
//
//  Created by Florian Pircher on 03.07.24.
//  Copyright © 2024 schriftgestaltung.de. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/// Runs the given block on the main queue synchronously.
///
/// If the function is called on the main queue, the block is invoked immediately.
/// Otherwise, the block is dispatched synchronously on the main queue.
///
/// > Warning: This can deadlock when the main queue is sync-dispatching another queue on which this function is called.
void GSDispatchSyncMain(void (^body)(void));

/// Runs the given block on the main queue synchronously.
///
/// If the function is called on the main queue, the block is invoked immediately.
/// Otherwise, the block is dispatched asynchronously on the main queue.
void GSDispatchAsyncMain(void (^body)(void));

NS_ASSUME_NONNULL_END
