Re: [Sablevm-developer] java.lang.Thread.yield()
Brought to you by:
egagnon
From: Prof. E. M. G. <eti...@uq...> - 2003-02-20 05:07:21
|
On Wed, Feb 19, 2003 at 11:23:31PM -0500, Chris Pickett wrote: > Okay, I looked at your solution, but apart from the goto end:, it=20 > doesn't seem different from the fix I suggested a couple of hours ago=20 > (ignoring the JNI_OK stuff): >...=20 > is there really a big difference? or are you mainly talking about the=20 > comment? It seems I have read your code a little too quickly; I thought you were calling _svmf_abort(or fatal_error?) [this is why I was talking about aborting]. It's probably because it is late, and because without the goto end I assumed the call didn't return (which is what _svmm_fatal_error() does). The "goto end" is important for maintenance. Imagine somebody modifies the code: if (sched_yield() !=3D 0) _svmf_error_InternalError (env); yield_done =3D JNI_TRUE; =2E.. This would be wrong, whereas: if (sched_yield() !=3D 0) = = =20 { _svmf_error_InternalError (env); = = =20 goto end; } yield_done =3D JNI_TRUE; = = =20 end: =2E.. does the intended thing. > P.S. Can you get the JNI book online? I have the JVM spec as part of=20 > the Java docs, but I take it this is something else. Not really. Only the specification part is online (with a few errors, though), but the user guide part is not. Prof. Hendren should have a copy of it somewhere. Etienne --=20 Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |