equal
deleted
inserted
replaced
1920 jbyte prev = _cancelled_gc.cmpxchg(CANCELLED, CANCELLABLE); |
1920 jbyte prev = _cancelled_gc.cmpxchg(CANCELLED, CANCELLABLE); |
1921 if (prev == CANCELLABLE) return true; |
1921 if (prev == CANCELLABLE) return true; |
1922 else if (prev == CANCELLED) return false; |
1922 else if (prev == CANCELLED) return false; |
1923 assert(ShenandoahSuspendibleWorkers, "should not get here when not using suspendible workers"); |
1923 assert(ShenandoahSuspendibleWorkers, "should not get here when not using suspendible workers"); |
1924 assert(prev == NOT_CANCELLED, "must be NOT_CANCELLED"); |
1924 assert(prev == NOT_CANCELLED, "must be NOT_CANCELLED"); |
1925 { |
1925 if (Thread::current()->is_Java_thread()) { |
1926 // We need to provide a safepoint here, otherwise we might |
1926 // We need to provide a safepoint here, otherwise we might |
1927 // spin forever if a SP is pending. |
1927 // spin forever if a SP is pending. |
1928 ThreadBlockInVM sp(JavaThread::current()); |
1928 ThreadBlockInVM sp(JavaThread::current()); |
1929 SpinPause(); |
1929 SpinPause(); |
1930 } |
1930 } |