* java/lang/natObject.cc (is_mp): Protect use of _SC_NPROCESSORS_ONLN.

From-SVN: r44771
This commit is contained in:
Loren J. Rittle 2001-08-10 17:37:41 +00:00 committed by Loren J. Rittle
parent d67c7dd855
commit cc3835e651
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2001-08-10 Loren J. Rittle <ljrittle@acm.org>
* java/lang/natObject.cc (is_mp): Protect use of _SC_NPROCESSORS_ONLN.
2001-08-06 Tom Tromey <tromey@redhat.com>
* java/io/InputStreamReader.java (refill): Only call refill on

View File

@ -436,8 +436,12 @@ typedef size_t obj_addr_t; /* Integer type big enough for object */
static bool
is_mp()
{
#ifdef _SC_NPROCESSORS_ONLN
long nprocs = sysconf(_SC_NPROCESSORS_ONLN);
return (nprocs > 1);
#else
return false;
#endif
}
// A call to keep_live(p) forces p to be accessible to the GC