//
//  PSMutex.h
//  ArmorP3V1
//

#import <Foundation/Foundation.h>

@interface PSMutex : NSObject<UIAlertViewDelegate>

@property (atomic, readonly) UIAlertView* memoryAlert;
@property (atomic, readonly) UIAlertView* stillWorkingAlert;
@property (atomic, readonly) BOOL isRunnningTask;
@property (atomic, readonly) BOOL isHaveMemoryAlert;
@property (atomic, readonly) NSArray* callStackForMemoryAlert;

+(PSMutex*)mainMutex;
+(void)createMainMutex;

-(BOOL)tryEnterTask;
-(void)endTask;

-(void)raiseMemoryError;
-(void)showMemoryAlertIfError;
-(void)showStillWorkingAlert;

@end
