mirror of https://github.com/tidwall/evio.git
Merge pull request #57 from coyove/coyove/fixendian
Fix Poll.Trigger byte order bug under linux
This commit is contained in:
commit
3d2e3575bc
|
@ -6,6 +6,7 @@ package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"syscall"
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Poll ...
|
// Poll ...
|
||||||
|
@ -44,7 +45,8 @@ func (p *Poll) Close() error {
|
||||||
// Trigger ...
|
// Trigger ...
|
||||||
func (p *Poll) Trigger(note interface{}) error {
|
func (p *Poll) Trigger(note interface{}) error {
|
||||||
p.notes.Add(note)
|
p.notes.Add(note)
|
||||||
_, err := syscall.Write(p.wfd, []byte{0, 0, 0, 0, 0, 0, 0, 1})
|
var x uint64 = 1
|
||||||
|
_, err := syscall.Write(p.wfd, (*(*[8]byte)(unsafe.Pointer(&x)))[:])
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue