aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKenneth Bell <[email protected]>2021-05-16 11:05:23 -0700
committerRon Evans <[email protected]>2021-05-28 00:02:46 +0200
commitfd8938c6346010979992986b2a1b512449e5c866 (patch)
treeda169de1305b3cf75abbd76c13a9e1f4f2ee015e
parentfa3dd41a4fc211cc4af971930d867ad0944cdc12 (diff)
downloadtinygo-fd8938c6346010979992986b2a1b512449e5c866.tar.gz
tinygo-fd8938c6346010979992986b2a1b512449e5c866.zip
scheduler: task.Data made 64bit to avoid overflow
-rw-r--r--src/internal/task/task.go2
-rw-r--r--src/runtime/scheduler.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/internal/task/task.go b/src/internal/task/task.go
index 489400dfc..bad501b61 100644
--- a/src/internal/task/task.go
+++ b/src/internal/task/task.go
@@ -13,7 +13,7 @@ type Task struct {
Ptr unsafe.Pointer
// Data is a field which can be used for storing state information.
- Data uint
+ Data uint64
// state is the underlying running state of the task.
state state
diff --git a/src/runtime/scheduler.go b/src/runtime/scheduler.go
index c5286d33b..44b07f75d 100644
--- a/src/runtime/scheduler.go
+++ b/src/runtime/scheduler.go
@@ -88,7 +88,7 @@ func addSleepTask(t *task.Task, duration timeUnit) {
panic("runtime: addSleepTask: expected next task to be nil")
}
}
- t.Data = uint(duration) // TODO: longer durations
+ t.Data = uint64(duration)
now := ticks()
if sleepQueue == nil {
scheduleLog(" -> sleep new queue")