Skip to content

为什么用这个b unsafe.Pointer 而不用这个*bucket #47

@EddieChan1993

Description

@EddieChan1993
// Timer represents a single event. When the Timer expires, the given
// task will be executed.
type Timer struct {
   expiration int64 // in milliseconds
   task       func()

   // The bucket that holds the list to which this timer's element belongs.
   //
   // NOTE: This field may be updated and read concurrently,
   // through Timer.Stop() and Bucket.Flush().
   b unsafe.Pointer // type: *bucket

   // The timer's element.
   element *list.Element
}

有什么考究吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions