Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 857 for crBlock (0.16 sec)

  1. src/image/jpeg/writer.go

    func toYCbCr(m image.Image, p image.Point, yBlock, cbBlock, crBlock *block) {
    	b := m.Bounds()
    	xmax := b.Max.X - 1
    	ymax := b.Max.Y - 1
    	for j := 0; j < 8; j++ {
    		for i := 0; i < 8; i++ {
    			r, g, b, _ := m.At(min(p.X+i, xmax), min(p.Y+j, ymax)).RGBA()
    			yy, cb, cr := color.RGBToYCbCr(uint8(r>>8), uint8(g>>8), uint8(b>>8))
    			yBlock[8*j+i] = int32(yy)
    			cbBlock[8*j+i] = int32(cb)
    			crBlock[8*j+i] = int32(cr)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:45 UTC 2023
    - 17.1K bytes
    - Viewed (0)
  2. src/sync/rwmutex_test.go

    		<-cdone
    	}
    }
    
    func TestRWMutex(t *testing.T) {
    	var m RWMutex
    
    	m.Lock()
    	if m.TryLock() {
    		t.Fatalf("TryLock succeeded with mutex locked")
    	}
    	if m.TryRLock() {
    		t.Fatalf("TryRLock succeeded with mutex locked")
    	}
    	m.Unlock()
    
    	if !m.TryLock() {
    		t.Fatalf("TryLock failed with mutex unlocked")
    	}
    	m.Unlock()
    
    	if !m.TryRLock() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 29 17:13:13 UTC 2021
    - 4.9K bytes
    - Viewed (0)
  3. platforms/core-runtime/time/src/main/java/org/gradle/internal/time/Clock.java

    import org.gradle.internal.service.scopes.Scope;
    import org.gradle.internal.service.scopes.ServiceScope;
    
    /**
     * A device for obtaining the current time.
     *
     * @see Time#clock()
     */
    @ServiceScope(Scope.Global.class)
    public interface Clock {
    
        /**
         * The current time in millis.
         */
        long getCurrentTime();
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed Apr 17 00:47:05 UTC 2024
    - 974 bytes
    - Viewed (0)
  4. src/runtime/rwmutex_test.go

    	"testing"
    )
    
    func parallelReader(m *RWMutex, clocked chan bool, cunlock *atomic.Bool, cdone chan bool) {
    	m.RLock()
    	clocked <- true
    	for !cunlock.Load() {
    	}
    	m.RUnlock()
    	cdone <- true
    }
    
    func doTestParallelReaders(numReaders int) {
    	GOMAXPROCS(numReaders + 1)
    	var m RWMutex
    	m.Init()
    	clocked := make(chan bool, numReaders)
    	var cunlock atomic.Bool
    	cdone := make(chan bool)
    	for i := 0; i < numReaders; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 15 22:00:45 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  5. src/sync/rwmutex.go

    	}
    }
    
    // TryLock tries to lock rw for writing and reports whether it succeeded.
    //
    // Note that while correct uses of TryLock do exist, they are rare,
    // and use of TryLock is often a sign of a deeper problem
    // in a particular use of mutexes.
    func (rw *RWMutex) TryLock() bool {
    	if race.Enabled {
    		_ = rw.w.state
    		race.Disable()
    	}
    	if !rw.w.TryLock() {
    		if race.Enabled {
    			race.Enable()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  6. src/sync/mutex_test.go

    		if i%3 == 0 {
    			if m.TryLock() {
    				m.Unlock()
    			}
    			continue
    		}
    		m.Lock()
    		m.Unlock()
    	}
    	cdone <- true
    }
    
    func TestMutex(t *testing.T) {
    	if n := runtime.SetMutexProfileFraction(1); n != 0 {
    		t.Logf("got mutexrate %d expected 0", n)
    	}
    	defer runtime.SetMutexProfileFraction(0)
    
    	m := new(Mutex)
    
    	m.Lock()
    	if m.TryLock() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 16 21:25:35 UTC 2022
    - 5.9K bytes
    - Viewed (0)
  7. internal/dsync/drwmutex_test.go

    	clocked := make(chan bool)
    	cunlock := make(chan bool)
    	cdone := make(chan bool)
    	for i := 0; i < numReaders; i++ {
    		go parallelReader(context.Background(), m, clocked, cunlock, cdone)
    	}
    	// Wait for all parallel RLock()s to succeed.
    	for i := 0; i < numReaders; i++ {
    		<-clocked
    	}
    	for i := 0; i < numReaders; i++ {
    		cunlock <- true
    	}
    	// Wait for the goroutines to finish.
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sat Dec 24 03:49:07 UTC 2022
    - 9.7K bytes
    - Viewed (0)
  8. internal/lsync/lrwmutex_test.go

    	if m.GetRLock(ctx, "", "", time.Second) {
    		clocked <- true
    		<-cunlock
    		m.RUnlock()
    		cdone <- true
    	}
    }
    
    // Borrowed from rwmutex_test.go
    func doTestParallelReaders(numReaders, gomaxprocs int) {
    	runtime.GOMAXPROCS(gomaxprocs)
    	m := NewLRWMutex()
    
    	clocked := make(chan bool)
    	cunlock := make(chan bool)
    	cdone := make(chan bool)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sun Mar 05 04:57:35 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apimachinery/pkg/util/cache/expiring.go

    	"sync"
    	"time"
    
    	"k8s.io/utils/clock"
    )
    
    // NewExpiring returns an initialized expiring cache.
    func NewExpiring() *Expiring {
    	return NewExpiringWithClock(clock.RealClock{})
    }
    
    // NewExpiringWithClock is like NewExpiring but allows passing in a custom
    // clock for testing.
    func NewExpiringWithClock(clock clock.Clock) *Expiring {
    	return &Expiring{
    		clock: clock,
    		cache: make(map[interface{}]entry),
    	}
    }
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 22 15:51:23 UTC 2023
    - 5.6K bytes
    - Viewed (0)
  10. pkg/proxy/healthcheck/proxier_health.go

    	return newProxierHealthServer(stdNetListener{}, stdHTTPServerFactory{}, clock.RealClock{}, addr, healthTimeout)
    }
    
    func newProxierHealthServer(listener listener, httpServerFactory httpServerFactory, c clock.Clock, addr string, healthTimeout time.Duration) *ProxierHealthServer {
    	return &ProxierHealthServer{
    		listener:      listener,
    		httpFactory:   httpServerFactory,
    		clock:         c,
    		addr:          addr,
    		healthTimeout: healthTimeout,
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 16 10:41:18 UTC 2023
    - 8K bytes
    - Viewed (0)
Back to top