1package task 2 3import ( 4 "unsafe" 5) 6 7// Task is a state of goroutine for scheduling purposes. 8type Task struct { 9 // Next is a field which can be used to make a linked list of tasks. 10 Next *Task 11 12 // Ptr is a field which can be used for storing a pointer. 13 Ptr unsafe.Pointer 14 15 // Data is a field which can be used for storing state information. 16 Data uint 17 18 // state is the underlying running state of the task. 19 state state 20} 21