ReadyTalk / avian

[INACTIVE] Avian is a lightweight virtual machine and class library designed to provide a useful subset of Java's features, suitable for building self-contained applications.
https://readytalk.github.io/avian/
Other
1.22k stars 173 forks source link

Problem with Thread on Android class path #342

Closed bigfatbrowncat closed 10 years ago

bigfatbrowncat commented 10 years ago

I tried to use SimpleFramework (http://www.simpleframework.org) with Avian and Android class path. Unfortunately it doesn't work (it doesn't start listening for socket and just finishes) .

I have analyzed the cause of this problem and found these lines:

State state = thread.getState();
if(state == NEW) {
   thread.start();
}

But state is never NEW. It's always RUNNABLE. After a short search I've found this function:

extern "C" AVIAN_EXPORT int64_t JNICALL
    Avian_java_lang_Thread_nativeGetStatus(Thread*, object, uintptr_t*)
{
  // todo
  return 1;
}

It sets thread status to RUNNABLE value constantly and certainly should be implemented. Is it hard to implement it?

bigfatbrowncat commented 10 years ago

@dicej, your patch https://github.com/dicej/avian/commit/ffb0f9b345f419a0d2be2a3ccc376e4d7e2c0884 works in the case. Are you going to pull it to master? (I've wrote that here in order to document it - to pull it right after my pull request)

dicej commented 10 years ago

Yes, after 1.1 is released (hopefully today).

bigfatbrowncat commented 10 years ago

What about this? Is it still blocked? By the way, maybe there is a clearer solution...

dicej commented 10 years ago

This was pulled in as part of one of the recent pull requests, so it's fixed in master now.