mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 10:32:29 +00:00
feat(thread): add thread functions
This commit is contained in:
parent
d0487caba3
commit
266bdc7737
16 changed files with 523 additions and 0 deletions
23
storm/thread/mac/SThreadRunner.mm
Normal file
23
storm/thread/mac/SThreadRunner.mm
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#include "thread/mac/SThreadRunner.h"
|
||||
#include "thread/S_Thread.hpp"
|
||||
|
||||
@implementation SThreadRunner
|
||||
|
||||
- (instancetype)init:(SThreadParmBlock*)params {
|
||||
if (self = [super init]) {
|
||||
self.m_params = params;
|
||||
self.m_autoreleasePool = nullptr;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)run {
|
||||
self.m_autoreleasePool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
S_Thread::s_SLaunchThread(self.m_params);
|
||||
|
||||
[self.m_autoreleasePool release];
|
||||
}
|
||||
|
||||
@end
|
||||
Loading…
Add table
Add a link
Reference in a new issue