//
//  NSThread+DDCategory.m
//  DDCategoryKit_Private
//  Created by DDIsFriend on 2022/12/28.
    

#import "NSThread+DDCategory.h"
#import <objc/runtime.h>

@implementation NSThread (DDCategory)
+ (instancetype)defaultRunThread{
    return [[NSThread alloc] initWithBlock:^{
        NSRunLoop *currentRunLoop = [NSRunLoop currentRunLoop];
        while (!NSThread.currentThread.isCancelled) {
            [currentRunLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate date]];
        }
        NSAssert([NSThread currentThread].isCancelled, @"%@ 子线程即将 'exit' ",[NSThread currentThread]);
    }];;
}
@end
