#import "HJViewController.h"
#import <pthread.h>
@interface HJViewController ()
@end
@implementation HJViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)pthreadDemo{
int result = pthread_create(&thread_t, NULL, &demo, (__bridge void *)(name));
if (result == 0) { NSLog(@"OK");}else { NSLog(@"NO");}}
void * demo(void *param) {
NSLog(@"%@%@",[NSThread currentThread],param);return NULL;}
- (void)touchesBegan:(NSSet<UITouch *> *)touches
withEvent:(UIEvent *)event{
}
@end
新闻热点
疑难解答