Re: [Sablevm-developer] java.lang.Thread.yield()
Brought to you by:
egagnon
From: Prof. E. M. G. <eti...@uq...> - 2003-02-20 03:01:17
|
On Wed, Feb 19, 2003 at 09:35:54PM -0500, Chris Pickett wrote: > Okay. Where is JNI_OK defined? My first question would be: why do you need this information? > Well, actually, I realized last night about checking the error status,=20 > after I emailed you to say that I would send a patch today, but then=20 > today you had already committed the code. Then I got caught up in=20 > making scripts, and didn't get around to telling you yet. >=20 > sched_yield() returns 0 if there was no problem, or -1 if there was an=20 > error. >=20 > sched_yield() is not necessarily posix compliant, so perhaps you'd=20 > better use pthread_yield() ... pthread_yield() doesn't return a value=20 > ever either, so just replace sched_yield() with pthread_yield() and=20 > forget about the error check. My documentation says: $ man sched_yield =2E.. CONFORMING TO POSIX.1b (formerly POSIX.4) =2E.. Also, aborting the VM if this call fails is quite dramatic! The VM should only be aborted if you have detected an error in the VM itself, or if something REALLY bad happened (e.g. memory corruption). Otherwize, you throw either an "expected" exception (if appropriate), or you throw Error otherwise, as specified in the Java+JVM specifications. OK. Next time you'll be more careful and ask questions if you are unsure. ;-) I encourage you to look at my fix to your code, once I check-it in CVS. Etienne --=20 Etienne M. Gagnon, Ph.D. http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |