addop := ssa.OpAdd64F
subop := ssa.OpSub64F
pt := floatForComplex(n.Type) // Could be Float32 or Float64
- wt := types.Types[TFLOAT64] // Compute in Float64 to minimize cancelation error
+ wt := types.Types[TFLOAT64] // Compute in Float64 to minimize cancellation error
areal := s.newValue1(ssa.OpComplexReal, pt, a)
breal := s.newValue1(ssa.OpComplexReal, pt, b)
subop := ssa.OpSub64F
divop := ssa.OpDiv64F
pt := floatForComplex(n.Type) // Could be Float32 or Float64
- wt := types.Types[TFLOAT64] // Compute in Float64 to minimize cancelation error
+ wt := types.Types[TFLOAT64] // Compute in Float64 to minimize cancellation error
areal := s.newValue1(ssa.OpComplexReal, pt, a)
breal := s.newValue1(ssa.OpComplexReal, pt, b)
// license that can be found in the LICENSE file.
// Package lostcancel defines an Analyzer that checks for failure to
-// call a context cancelation function.
+// call a context cancellation function.
package lostcancel
import (
const Doc = `check cancel func returned by context.WithCancel is called
-The cancelation function returned by context.WithCancel, WithTimeout,
+The cancellation function returned by context.WithCancel, WithTimeout,
and WithDeadline must be called or the new context will remain live
until its parent context is cancelled.
(The background context is never cancelled.)`
// license that can be found in the LICENSE file.
// Package context defines the Context type, which carries deadlines,
-// cancelation signals, and other request-scoped values across API boundaries
+// cancellation signals, and other request-scoped values across API boundaries
// and between processes.
//
// Incoming requests to a server should create a Context, and outgoing
"time"
)
-// A Context carries a deadline, a cancelation signal, and other values across
+// A Context carries a deadline, a cancellation signal, and other values across
// API boundaries.
//
// Context's methods may be called by multiple goroutines simultaneously.
// }
//
// See https://blog.golang.org/pipelines for more examples of how to use
- // a Done channel for cancelation.
+ // a Done channel for cancellation.
Done() <-chan struct{}
// If Done is not yet closed, Err returns nil.
}
cancel()
- time.Sleep(100 * time.Millisecond) // let cancelation propagate
+ time.Sleep(100 * time.Millisecond) // let cancellation propagate
for i, c := range contexts {
select {
o := otherContext{c}
c, cancel := WithTimeout(o, 2*time.Second)
cancel()
- time.Sleep(100 * time.Millisecond) // let cancelation propagate
+ time.Sleep(100 * time.Millisecond) // let cancellation propagate
select {
case <-c.Done():
default:
ctx, cancel := context.WithDeadline(context.Background(), d)
// Even though ctx will be expired, it is good practice to call its
- // cancelation function in any case. Failure to do so may keep the
+ // cancellation function in any case. Failure to do so may keep the
// context and its parent alive longer than necessary.
defer cancel()
// The sql package must be used in conjunction with a database driver.
// See https://golang.org/s/sqldrivers for a list of drivers.
//
-// Drivers that do not support context cancelation will not return until
+// Drivers that do not support context cancellation will not return until
// after the query is completed.
//
// For usage examples, see the wiki page at
s.req <- ioSrvReq{o, nil}
<-o.errc
}
- // Wait for cancelation to complete.
+ // Wait for cancellation to complete.
fd.pd.waitCanceled(int(o.mode))
if o.errno != 0 {
err = syscall.Errno(o.errno)
}
return 0, err
}
- // We issued a cancelation request. But, it seems, IO operation succeeded
- // before the cancelation request run. We need to treat the IO operation as
+ // We issued a cancellation request. But, it seems, IO operation succeeded
+ // before the cancellation request run. We need to treat the IO operation as
// succeeded (the bytes are actually sent/recv from network).
return int(o.qty), nil
}
// = 1/sqrt(2) * (cos(x) + sin(x))
// sin(x0) = sin(x)cos(pi/4)-cos(x)sin(pi/4)
// = 1/sqrt(2) * (sin(x) - cos(x))
-// (To avoid cancelation, use
+// (To avoid cancellation, use
// sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
// to compute the worse one.)
//
// = 1/sqrt(2) * (sin(x) + cos(x))
// sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
// = 1/sqrt(2) * (sin(x) - cos(x))
- // To avoid cancelation, use
+ // To avoid cancellation, use
// sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
// to compute the worse one.
// = 1/sqrt(2) * (sin(x) - cos(x))
// sin(x1) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
// = -1/sqrt(2) * (sin(x) + cos(x))
-// (To avoid cancelation, use
+// (To avoid cancellation, use
// sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
// to compute the worse one.)
//
// = 1/sqrt(2) * (sin(x) - cos(x))
// sin(x0) = sin(x)cos(3pi/4)-cos(x)sin(3pi/4)
// = -1/sqrt(2) * (cos(x) + sin(x))
- // To avoid cancelation, use
+ // To avoid cancellation, use
// sin(x) +- cos(x) = -cos(2x)/(sin(x) -+ cos(x))
// to compute the worse one.
// Cancel is an optional channel whose closure indicates that
// the dial should be canceled. Not all types of dials support
- // cancelation.
+ // cancellation.
//
// Deprecated: Use DialContext instead.
Cancel <-chan struct{}
origTestHookDialTCP := testHookDialTCP
defer func() { testHookDialTCP = origTestHookDialTCP }()
testHookDialTCP = func(ctx context.Context, net string, laddr, raddr *TCPAddr) (*TCPConn, error) {
- // Sleep long enough for Happy Eyeballs to kick in, and inhibit cancelation.
+ // Sleep long enough for Happy Eyeballs to kick in, and inhibit cancellation.
// This forces dialParallel to juggle two successful connections.
time.Sleep(fallbackDelay * 2)
d := &Dialer{Cancel: cancel}
c, err := d.Dial("tcp", ln.Addr().String())
- // Immediately after dialing, request cancelation and sleep.
+ // Immediately after dialing, request cancellation and sleep.
// Before Issue 15078 was fixed, this would cause subsequent operations
// to fail with an i/o timeout roughly 50% of the time.
close(cancel)
// For compatibility, the Client will also use the deprecated
// CancelRequest method on Transport if found. New
// RoundTripper implementations should use the Request's Context
- // for cancelation instead of implementing CancelRequest.
+ // for cancellation instead of implementing CancelRequest.
Timeout time.Duration
}
reqBodyClosed = true
if !deadline.IsZero() && didTimeout() {
err = &httpError{
- // TODO: early in cycle: s/Client.Timeout exceeded/timeout or context cancelation/
+ // TODO: early in cycle: s/Client.Timeout exceeded/timeout or context cancellation/
err: err.Error() + " (Client.Timeout exceeded while awaiting headers)",
timeout: true,
}
}
if b.reqDidTimeout() {
err = &httpError{
- // TODO: early in cycle: s/Client.Timeout exceeded/timeout or context cancelation/
+ // TODO: early in cycle: s/Client.Timeout exceeded/timeout or context cancellation/
err: err.Error() + " (Client.Timeout exceeded while reading body)",
timeout: true,
}
const maxInt64 = 1<<63 - 1
// aLongTimeAgo is a non-zero time, far in the past, used for
-// immediate cancelation of network operations.
+// immediate cancellation of network operations.
var aLongTimeAgo = time.Unix(1, 0)
// TODO(bradfitz): move common stuff here. The other files have accumulated
// The returned context is always non-nil; it defaults to the
// background context.
//
-// For outgoing client requests, the context controls cancelation.
+// For outgoing client requests, the context controls cancellation.
//
// For incoming server requests, the context is canceled when the
// client's connection closes, the request is canceled (with HTTP/2),
b = append(b, up.Username...)
b = append(b, byte(len(up.Password)))
b = append(b, up.Password...)
- // TODO(mikio): handle IO deadlines and cancelation if
+ // TODO(mikio): handle IO deadlines and cancellation if
// necessary
if _, err := rw.Write(b); err != nil {
return err
t.decHostConnCount(cmKey)
select {
case <-req.Cancel:
- // It was an error due to cancelation, so prioritize that
+ // It was an error due to cancellation, so prioritize that
// error value. (Issue 16049)
return nil, errRequestCanceledConn
case <-req.Context().Done():
}
return nil, err
default:
- // It wasn't an error due to cancelation, so
+ // It wasn't an error due to cancellation, so
// return the original error message:
return nil, v.err
}
}
// canceled returns non-nil if the connection was closed due to
-// CancelRequest or due to context cancelation.
+// CancelRequest or due to context cancellation.
func (pc *persistConn) canceled() error {
pc.mu.Lock()
defer pc.mu.Unlock()
// Before looping back to the top of this function and peeking on
// the bufio.Reader, wait for the caller goroutine to finish
- // reading the response body. (or for cancelation or death)
+ // reading the response body. (or for cancellation or death)
select {
case bodyEOF := <-waitForBodyRead:
pc.t.setReqCanceler(rc.req, nil) // before pc might return to idle pool
}
} else {
if err == nil || !strings.Contains(err.Error(), "canceled") {
- t.Errorf("Do error = %v; want cancelation", err)
+ t.Errorf("Do error = %v; want cancellation", err)
}
}
}
resolverFunc = alt
}
- // We don't want a cancelation of ctx to affect the
+ // We don't want a cancellation of ctx to affect the
// lookupGroup operation. Otherwise if our context gets
// canceled it might cause an error to be returned to a lookup
// using a completely different context. However we need to preserve
var (
// aLongTimeAgo is a non-zero time, far in the past, used for
- // immediate cancelation of dials.
+ // immediate cancellation of dials.
aLongTimeAgo = time.Unix(1, 0)
// nonDeadline and noCancel are just zero values for
}
// TestRacyRead tests that it is safe to mutate the input Read buffer
-// immediately after cancelation has occurred.
+// immediately after cancellation has occurred.
func TestRacyRead(t *testing.T) {
t.Parallel()
}
// TestRacyWrite tests that it is safe to mutate the input Write buffer
-// immediately after cancelation has occurred.
+// immediately after cancellation has occurred.
func TestRacyWrite(t *testing.T) {
t.Parallel()
/* 33 */ {_SigNotify, "SIGLWP: reserved signal no longer used by"},
/* 34 */ {_SigNotify, "SIGFREEZE: special signal used by CPR"},
/* 35 */ {_SigNotify, "SIGTHAW: special signal used by CPR"},
- /* 36 */ {_SigSetStack + _SigUnblock, "SIGCANCEL: reserved signal for thread cancellation"}, // Oracle's spelling of cancelation.
+ /* 36 */ {_SigSetStack + _SigUnblock, "SIGCANCEL: reserved signal for thread cancellation"}, // Oracle's spelling of cancellation.
/* 37 */ {_SigNotify, "SIGLOST: resource lost (eg, record-lock lost)"},
/* 38 */ {_SigNotify, "SIGXRES: resource control exceeded"},
/* 39 */ {_SigNotify, "SIGJVM1: reserved signal for Java Virtual Machine"},
}
// testRacyRead tests that it is safe to mutate the input Read buffer
-// immediately after cancelation has occurred.
+// immediately after cancellation has occurred.
func testRacyRead(t *testing.T, c1, c2 net.Conn) {
go chunkedCopy(c2, rand.New(rand.NewSource(0)))
}
// testRacyWrite tests that it is safe to mutate the input Write buffer
-// immediately after cancelation has occurred.
+// immediately after cancellation has occurred.
func testRacyWrite(t *testing.T, c1, c2 net.Conn) {
go chunkedCopy(ioutil.Discard, c2)
defer wg.Wait()
wg.Add(3)
- // Test for cancelation upon connection closure.
+ // Test for cancellation upon connection closure.
c1.SetDeadline(neverTimeout)
go func() {
defer wg.Done()