GCC with patches for OS216
修订版 | 210da6f5296357d4d9afdb03cda7dbfcdeeeff63 (tree) |
---|---|
时间 | 1999-08-18 07:42:27 |
作者 | Rainer Orth <ro@Tech...> |
Commiter | Tom Tromey |
gc_priv.h: Merged IRIX thread changes from include/private/gc_priv.h.
Tue Aug 10 00:08:29 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* gc_priv.h: Merged IRIX thread changes from
include/private/gc_priv.h.
From-SVN: r28739
@@ -1,3 +1,8 @@ | ||
1 | +Tue Aug 10 00:08:29 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> | |
2 | + | |
3 | + * gc_priv.h: Merged IRIX thread changes from | |
4 | + include/private/gc_priv.h. | |
5 | + | |
1 | 6 | 1999-08-04 Tom Tromey <tromey@cygnus.com> |
2 | 7 | |
3 | 8 | * configure.in: Added missing `;;'. From Anthony Green. |
@@ -497,14 +497,15 @@ void GC_print_callers (/* struct callinfo info[NFRAMES] */); | ||
497 | 497 | } |
498 | 498 | # define EXIT_GC() GC_collecting = 0; |
499 | 499 | # endif /* LINUX_THREADS */ |
500 | -# ifdef IRIX_THREADS | |
500 | +# if defined(IRIX_THREADS) || defined(IRIX_JDK_THREADS) | |
501 | 501 | # include <pthread.h> |
502 | 502 | # include <mutex.h> |
503 | 503 | |
504 | -# if __mips < 3 || !(defined (_ABIN32) || defined(_ABI64)) | |
504 | +# if __mips < 3 || !(defined (_ABIN32) || defined(_ABI64)) \ | |
505 | + || !defined(_COMPILER_VERSION) || _COMPILER_VERSION < 700 | |
505 | 506 | # define GC_test_and_set(addr, v) test_and_set(addr,v) |
506 | 507 | # else |
507 | -# define GC_test_and_set(addr, v) __test_and_set(addr,v) | |
508 | +# define GC_test_and_set(addr, v) __test_and_set(addr,v) | |
508 | 509 | # endif |
509 | 510 | extern unsigned long GC_allocate_lock; |
510 | 511 | /* This is not a mutex because mutexes that obey the (optional) */ |
@@ -523,10 +524,17 @@ void GC_print_callers (/* struct callinfo info[NFRAMES] */); | ||
523 | 524 | # define UNLOCK() pthread_mutex_unlock(&GC_allocate_ml) |
524 | 525 | # else |
525 | 526 | # define LOCK() { if (GC_test_and_set(&GC_allocate_lock, 1)) GC_lock(); } |
526 | -# if __mips >= 3 && (defined (_ABIN32) || defined(_ABI64)) | |
527 | +# if __mips >= 3 && (defined (_ABIN32) || defined(_ABI64)) \ | |
528 | + && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 700 | |
527 | 529 | # define UNLOCK() __lock_release(&GC_allocate_lock) |
528 | 530 | # else |
529 | -# define UNLOCK() GC_allocate_lock = 0 | |
531 | + /* The function call in the following should prevent the */ | |
532 | + /* compiler from moving assignments to below the UNLOCK. */ | |
533 | + /* This is probably not necessary for ucode or gcc 2.8. */ | |
534 | + /* It may be necessary for Ragnarok and future gcc */ | |
535 | + /* versions. */ | |
536 | +# define UNLOCK() { GC_noop1(&GC_allocate_lock); \ | |
537 | + *(volatile unsigned long *)(&GC_allocate_lock) = 0; } | |
530 | 538 | # endif |
531 | 539 | # endif |
532 | 540 | extern GC_bool GC_collecting; |
@@ -535,7 +543,7 @@ void GC_print_callers (/* struct callinfo info[NFRAMES] */); | ||
535 | 543 | GC_collecting = 1; \ |
536 | 544 | } |
537 | 545 | # define EXIT_GC() GC_collecting = 0; |
538 | -# endif /* IRIX_THREADS */ | |
546 | +# endif /* IRIX_THREADS || IRIX_JDK_THREADS */ | |
539 | 547 | # ifdef WIN32_THREADS |
540 | 548 | # include <windows.h> |
541 | 549 | GC_API CRITICAL_SECTION GC_allocate_ml; |
@@ -593,7 +601,7 @@ void GC_print_callers (/* struct callinfo info[NFRAMES] */); | ||
593 | 601 | # if defined(SRC_M3) || defined(AMIGA) || defined(SOLARIS_THREADS) \ |
594 | 602 | || defined(MSWIN32) || defined(MACOS) || defined(DJGPP) \ |
595 | 603 | || defined(NO_SIGNALS) || defined(IRIX_THREADS) \ |
596 | - || defined(LINUX_THREADS) | |
604 | + || defined(IRIX_JDK_THREADS) || defined(LINUX_THREADS) | |
597 | 605 | /* Also useful for debugging. */ |
598 | 606 | /* Should probably use thr_sigsetmask for SOLARIS_THREADS. */ |
599 | 607 | # define DISABLE_SIGNALS() |
@@ -621,7 +629,8 @@ void GC_print_callers (/* struct callinfo info[NFRAMES] */); | ||
621 | 629 | PCR_waitForever); |
622 | 630 | # else |
623 | 631 | # if defined(SOLARIS_THREADS) || defined(WIN32_THREADS) \ |
624 | - || defined(IRIX_THREADS) || defined(LINUX_THREADS) | |
632 | + || defined(IRIX_THREADS) || defined(LINUX_THREADS) \ | |
633 | + || defined(IRIX_JDK_THREADS) | |
625 | 634 | void GC_stop_world(); |
626 | 635 | void GC_start_world(); |
627 | 636 | # define STOP_WORLD() GC_stop_world() |