google / google/j2objc

dispatch_async and JavaLangThread: Assertion failed

Open
#341 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6k
Forks
999
Avg merge
19h 20m
Merged PRs (30d)
14

Description

I use GCD (grand central dispatch) in my app to dispatch so stuff in the background

dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(queue, ^{
[[self getEngine] doStuff];
});

The thing is that in my doStuff, so code, converted with j2objc is executed, and at some point in this code, a JavaLangThread object is initiated.
And every now and then, i get the following:

Assertion failed: (group != nil), function -[JavaLangThread createWithJavaLangThreadGroup:withJavaLangRunnable:withNSString:withLong:withBoolean:], file /Users/tball/tmp/moe_git_clone_github_7854296660712344514/jre_emul/build_result/Classes/java/lang/Thread.m, line 253.

When I say every know and then, I mean that the first time I call doStuff, it works, and the second time, I get the Assertion failed exception thingy.

I'm currently on j2obc 0.9, but I had this problem also with j2objc 0.8.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.