forked from inket/MacSymbolicator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a multi-target hanging app to test against
- Loading branch information
Showing
3 changed files
with
177 additions
and
1 deletion.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
MacSymbolicatorTests/TestProject/AnotherTarget/HangingClass.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// HangingClass.swift | ||
// AnotherTarget | ||
// | ||
|
||
import Foundation | ||
|
||
@objc | ||
public class HangingClass: NSObject { | ||
@objc | ||
public static func hang() { | ||
DispatchQueue.global().async { | ||
sleep(3600) | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
MacSymbolicatorTests/TestProject/MultiTargetHangingTest/main.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// main.m | ||
// MultiTargetHangingTest | ||
// | ||
|
||
@import Foundation; | ||
#import "AnotherTarget/AnotherTarget-Swift.h" | ||
|
||
@interface MyClass: NSObject | ||
@end | ||
|
||
@implementation MyClass | ||
|
||
- (void)start { | ||
NSLog(@"Multi-target hanging… sample/spindump this process using Activity Monitor"); | ||
[HangingClass hang]; | ||
[self hangingMethod]; // to stop it from exiting | ||
} | ||
|
||
- (void)hangingMethod { | ||
NSLock *lock = [[NSLock alloc] init]; | ||
[lock lock]; | ||
[lock lock]; | ||
} | ||
|
||
@end | ||
|
||
int main(int argc, const char * argv[]) { | ||
@autoreleasepool { | ||
[[[MyClass alloc] init] start]; | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters