Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRWebSocket.m give Hang risk warning in Xcode 14 #661

Open
maheshshahu opened this issue May 4, 2023 · 5 comments
Open

SRWebSocket.m give Hang risk warning in Xcode 14 #661

maheshshahu opened this issue May 4, 2023 · 5 comments

Comments

@maheshshahu
Copy link

- (NSRunLoop *)runLoop;
{
    dispatch_group_wait(_waitGroup, DISPATCH_TIME_FOREVER);
    return _runLoop;
}

error:- Thread running at QOS_CLASS_USER_INITIATED waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
Screenshot 2023-05-04 at 2 34 12 PM

@danipralea
Copy link

I have the same issue

1 similar comment
@wuyeAn
Copy link

wuyeAn commented May 15, 2023

I have the same issue

@anandyadav19901990
Copy link

adding qualityOfService to networkThread object solved the problem.

Screenshot 2023-05-16 at 4 19 06 PM

@funnel20
Copy link

funnel20 commented Sep 2, 2023

Here is the solution from @anandyadav19901990 in plain text, as macOS derives zeros from the upper case "O" in the original image:

+ (NSRunLoop *)SR_networkRunLoop {
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        networkThread = [[_SRRunLoopThread alloc] init];
        networkThread.name = @"com.squareup.SocketRocket.NetworkThread";
        networkThread.qualityOfService = NSQualityOfServiceUserInitiated;
        [networkThread start];
        networkRunLoop = networkThread.runLoop;
    });
    
    return networkRunLoop;
}

The new line is:

networkThread.qualityOfService = NSQualityOfServiceUserInitiated;

@funnel20
Copy link

funnel20 commented May 9, 2024

Note that the above solution applies to versions prior to 0.7.0, as it has been resolved in version 0.7.0:
7240f2d

Please close this issue and mark as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants