helpful panics
Juan Batiz-Benet committed
Jan 26, 2015 at 13:42 UTC
913a733e9b5efb1ba069dbf30580a2fe6b02e618
2 files changed
+13
-1
Godeps/Godeps.json
+1
-1
@@ -197,7 +197,7 @@
197
},
198
{
199
"ImportPath": "github.com/jbenet/goprocess",
200
- "Rev": "c5455a611a9e0cebac87e7ae421c3273c3224000"
200
+ "Rev": "060ad098994e6adac22f0bd889eb756d4f5ad35b"
201
},
202
{
203
"ImportPath": "github.com/kr/binarydist",
Godeps/_workspace/src/github.com/jbenet/goprocess/impl-mutex.go
+12
@@ -35,6 +35,10 @@ func newProcess(tf TeardownFunc) *process {
35
}
36
37
func (p *process) WaitFor(q Process) {
38
+ if q == nil {
39
+ panic("waiting for nil process")
40
+ }
41
+
42
p.Lock()
43
44
select {
@@ -48,6 +52,10 @@ func (p *process) WaitFor(q Process) {
52
}
53
54
func (p *process) AddChildNoWait(child Process) {
55
+ if child == nil {
56
+ panic("adding nil child process")
57
+ }
58
+
59
p.Lock()
60
61
select {
@@ -61,6 +69,10 @@ func (p *process) AddChildNoWait(child Process) {
69
}
70
71
func (p *process) AddChild(child Process) {
72
+ if child == nil {
73
+ panic("adding nil child process")
74
+ }
75
+
76
p.Lock()
77
78
select {