| 1 |
// Copyright 2010 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
// Export guts for testing. |
| 6 |
// Since testing imports os and os imports internal/poll, |
| 7 |
// the internal/poll tests can not be in package poll. |
| 8 |
|
| 9 |
package poll |
| 10 |
|
| 11 |
var Consume = consume |
| 12 |
|
| 13 |
type FDMutex struct { |
| 14 |
fdMutex |
| 15 |
} |
| 16 |
|
| 17 |
func (mu *FDMutex) Incref() bool { |
| 18 |
return mu.incref() |
| 19 |
} |
| 20 |
|
| 21 |
func (mu *FDMutex) IncrefAndClose() bool { |
| 22 |
return mu.increfAndClose() |
| 23 |
} |
| 24 |
|
| 25 |
func (mu *FDMutex) Decref() bool { |
| 26 |
return mu.decref() |
| 27 |
} |
| 28 |
|
| 29 |
func (mu *FDMutex) RWLock(read bool) bool { |
| 30 |
return mu.rwlock(read) |
| 31 |
} |
| 32 |
|
| 33 |
func (mu *FDMutex) RWUnlock(read bool) bool { |
| 34 |
return mu.rwunlock(read) |
| 35 |
} |
| 36 |
|
| 37 |
var Fcntl = fcntl |