summaryrefslogtreecommitdiff
path: root/test/chan
AgeCommit message (Collapse)AuthorFilesLines
2011-09-13Imported Upstream version 60upstream/60Ondřej Surý17-0/+3095
2011-09-13Imported Upstream version 60Ondřej Surý15-3047/+0
2011-04-26Imported Upstream version 2011.04.13upstream/2011.04.13Ondřej Surý2-11/+24
2011-02-18Imported Upstream version 2011.02.15upstream/2011.02.15Ondřej Surý1-1/+1
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý6-111/+685
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý8-684/+932
2010-04-01runtime: correct memory leak in selectRuss Cox1-0/+48
* adds pass 3 to dequeue from channels eagerly various other cleanup/churn: * use switch on cas->send in each pass to factor out common code. * longer goto labels, commented at target * be more agressive about can't happen: throw instead of print + cope. * use "select" instead of "selectgo" in errors * use printf for debug prints when possible R=ken2, ken3 CC=golang-dev, r http://codereview.appspot.com/875041
2010-03-30single argument panicRuss Cox4-104/+175
note that sortmain.go has been run through hg gofmt; only the formatting of the day initializers changed. i'm happy to revert that formatting if you'd prefer. stop on error in doc/progs/run R=r CC=golang-dev http://codereview.appspot.com/850041
2010-03-24delete all uses of panicln by rewriting them using panic or,Rob Pike1-16/+20
in the tests, println+panic. gofmt some tests too. R=rsc CC=golang-dev http://codereview.appspot.com/741041
2010-02-24Include an Eratosthenesque concurrent prime sieve to go along with the ↵Anh Hai Trinh2-2/+174
"naive" version. R=r CC=golang-dev http://codereview.appspot.com/218046 Committer: Rob Pike <r@golang.org>
2009-12-18runtime: fix race conditionAdam Langley1-0/+83
(Thanks to ken and rsc for pointing this out) rsc: ken pointed out that there's a race in the new one-lock-per-channel code. the issue is that if one goroutine has gone to sleep doing select { case <-c1: case <-c2: } and then two more goroutines try to send on c1 and c2 simultaneously, the way that the code makes sure only one wins is the selgen field manipulation in dequeue: // if sgp is stale, ignore it if(sgp->selgen != sgp->g->selgen) { //prints("INVALID PSEUDOG POINTER\n"); freesg(c, sgp); goto loop; } // invalidate any others sgp->g->selgen++; but because the global lock is gone both goroutines will be fiddling with sgp->g->selgen at the same time. This results in a 7% slowdown in the single threaded case for a ping-pong microbenchmark. Since the cas predominantly succeeds, adding a simple check first didn't make any difference. R=rsc CC=golang-dev http://codereview.appspot.com/180068
2009-12-09missed a couple of files in testRobert Griesemer1-12/+24
R=rsc, r http://codereview.appspot.com/172045
2009-12-09making some more non-gofmt'ed files save for new semicolon ruleRobert Griesemer1-12/+24
R=rsc, r http://codereview.appspot.com/171051
2009-09-15last round: non-package codeRuss Cox1-0/+9
R=r DELTA=127 (38 added, 3 deleted, 86 changed) OCL=34640 CL=34650
2009-08-17fix up some irregular indentationRob Pike1-32/+33
R=rsc OCL=33382 CL=33391
2009-08-12convert non-pkg go files to whole-package compilation.Russ Cox2-8/+4
mostly removing forward declarations. R=r DELTA=138 (2 added, 127 deleted, 9 changed) OCL=33068 CL=33099
2009-08-03more 6g reorg; checkpoint.Russ Cox1-4/+4
typecheck.c is now responsible for all type checking except for assignment and function argument "..." R=ken OCL=32661 CL=32667
2009-05-31Adjust expected errors to work with gccgo.Ian Lance Taylor1-4/+4
The change to assign.go is because the gcc testsuite fails to handle .* in a normal way: it matches against the entire compiler output, not just a single line. assign.go:15:6: error: incompatible types in assignment (implicit assignment of 'sync.Mutex' hidden field 'key') assign.go:19:6: error: incompatible types in assignment (implicit assignment of 'sync.Mutex' hidden field 'key') assign.go:23:6: error: incompatible types in assignment (implicit assignment of 'sync.Mutex' hidden field 'key') assign.go:27:6: error: incompatible types in assignment (implicit assignment of 'sync.Mutex' hidden field 'key') chan/perm.go:14:5: error: incompatible types in assignment chan/perm.go:15:5: error: incompatible types in assignment chan/perm.go:16:6: error: incompatible types in assignment chan/perm.go:17:6: error: incompatible types in assignment chan/perm.go:24:7: error: invalid send on receive-only channel chan/perm.go:25:12: error: invalid send on receive-only channel chan/perm.go:31:4: error: invalid receive on send-only channel chan/perm.go:32:9: error: invalid receive on send-only channel chan/perm.go:38:2: error: invalid send on receive-only channel chan/perm.go:42:2: error: invalid receive on send-only channel initializerr.go:14:17: error: reference to undefined variable 'X' initializerr.go:14:19: error: mixture of field and value initializers initializerr.go:15:26: error: duplicate value for field 'Y' initializerr.go:16:10: error: too many values in struct composite literal initializerr.go:18:19: error: index expression is not integer constant initializerr.go:17:11: error: too many elements in composite literal R=rsc DELTA=12 (0 added, 0 deleted, 12 changed) OCL=29657 CL=29665
2009-05-22channel direction testsRuss Cox1-0/+48
(will submit with compiler fixes). R=r DELTA=44 (44 added, 0 deleted, 0 changed) OCL=29211 CL=29248
2009-05-16Don't bother to import "os" just so that we can callIan Lance Taylor1-3/+0
os.Exit(0) at the end of main. R=rsc DELTA=6 (0 added, 6 deleted, 0 changed) OCL=28967 CL=28969
2009-05-08move things out of sys into os and runtimeRuss Cox6-10/+19
R=r OCL=28569 CL=28573
2009-04-17Step 1 of the Big Error Shift: make os.Error an interface and replace ↵Rob Pike1-1/+1
*os.Errors with os.Errors. lib/template updated to use new setup; its clients also updated. Step 2 will make os's error support internally much cleaner. R=rsc OCL=27586 CL=27586
2009-03-20range over channels.Russ Cox1-3/+3
also fix multiple-evaluation bug in range over arrays. R=ken OCL=26576 CL=26576
2009-03-03Automated g4 rollback of changelist 25024,Russ Cox3-3/+3
plus significant hand editing. Back to T{x} for composite literals. R=r OCL=25612 CL=25632
2009-02-13convert composite literals from { } to ( ).Russ Cox3-3/+3
only non-trivial changes are in convlit1.go golden.out R=gri OCL=25019 CL=25024
2009-02-11insert type assertions when narrowing.Russ Cox1-6/+6
R=r OCL=24349 CL=24913
2009-02-06powser cleanup.Rob Pike2-122/+104
- don't need *struct - don't need item/rat both - closures make the inner slaves easier - delete some old BUG comments powser2 is left mostly alone, for variety. R=rsc DELTA=134 (2 added, 20 deleted, 112 changed) OCL=24579 CL=24581
2009-01-23make test/chan/nonblock work even with real os threadsRuss Cox1-33/+62
R=ken OCL=23422 CL=23422
2009-01-20delete exportRuss Cox5-65/+65
TBR=r OCL=23121 CL=23127
2009-01-16convert tests; nothing interesting.Russ Cox5-67/+65
R=r OCL=23012 CL=23014
2009-01-16casify, cleanup sysRuss Cox6-10/+10
R=r OCL=22978 CL=22984
2009-01-15convert strconvRuss Cox1-1/+1
R=r DELTA=568 (0 added, 9 deleted, 559 changed) OCL=22898 CL=22901
2009-01-06new new & makeRuss Cox7-39/+39
R=r OCL=22166 CL=22166
2008-12-19change *map to map; *chan to chan; new(T) to new(*T)Russ Cox7-54/+48
fix bugs left over from *[] to [] conversion. TBR=r OCL=21576 CL=21581
2008-12-18convert *[] to [].Russ Cox2-8/+8
R=r OCL=21563 CL=21571
2008-12-09chans and maps of interfacesRuss Cox1-0/+720
R=r DELTA=746 (729 added, 1 deleted, 16 changed) OCL=20858 CL=20858
2008-11-18return *os.Error instead of bool from strconv.ato*Russ Cox1-3/+4
R=r DELTA=137 (56 added, 4 deleted, 77 changed) OCL=19505 CL=19522
2008-11-17correctly rounded floating-point conversionsRuss Cox1-2/+2
in new package strconv. move atoi etc to strconv too. update fmt, etc to use strconv. R=r DELTA=2232 (1691 added, 424 deleted, 117 changed) OCL=19286 CL=19380
2008-11-06Test case for evaluation order of select statement.Ian Lance Taylor1-0/+51
R=r DELTA=47 (47 added, 0 deleted, 0 changed) OCL=18581 CL=18748
2008-11-05Fix powser1.go to compile with the current 6g, which doesn'tIan Lance Taylor1-2/+2
recognize methods for a variable whose type is a named type which is a pointer type. Add bug117 to test this case. R=r DELTA=24 (22 added, 0 deleted, 2 changed) OCL=18547 CL=18554
2008-11-05Don't use a named pointer type as a receiver type. TheIan Lance Taylor1-2/+2
current spec forbids it: The type specified by the type name is called ``receiver base type''. The receiver base type must be a type declared in the current file, and it must not be a pointer type. R=r DELTA=2 (0 added, 0 deleted, 2 changed) OCL=18527 CL=18541
2008-10-07update code to follow new semicolon rules:Russ Cox2-6/+6
* 1. all statements and declarations are terminated by semicolons * 2. semicolons can be omitted at top level. * 3. semicolons can be omitted before and after the closing ) or } * on a list of statements or declarations. /home/rsc/bin/addsemi and then diff+tweak. R=r,gri OCL=16620 CL=16643
2008-10-04fix method use bug in powser1.Russ Cox1-6/+6
R=r DELTA=7 (2 added, 2 deleted, 3 changed) OCL=16495 CL=16499
2008-09-30104, 107, 108: they are known to fail, so mark them appropriately.Rob Pike1-0/+40
update golden add the "goroutines" test R=iant DELTA=74 (36 added, 23 deleted, 15 changed) OCL=16194 CL=16206
2008-09-26test and fix non-blocking chan ops on buffered chansRuss Cox1-56/+58
R=ken DELTA=68 (19 added, 0 deleted, 49 changed) OCL=15966 CL=15969
2008-09-16update tests to new communications syntaxRob Pike4-74/+53
powser1.go has not been tested - waiting for compiler to catch up R=ken OCL=15415 CL=15415
2008-09-11fixes for funcs without returnsRob Pike1-1/+1
R=ken OCL=15170 CL=15170
2008-08-27arraysKen Thompson1-3/+3
R=r OCL=14603 CL=14603
2008-08-11fix bug depot:Rob Pike4-69/+69
1) fix print statements, panic statements (parentheses required) 2) len is now allowed as a var name (bug053) R=gri OCL=14106 CL=14106
2008-08-05workaround for compiler bug: len(a) is zeroRob Pike1-3/+3
TBR=iant OCL=13873 CL=13873