Skip to content

x/sys: windows.GetCurrentThreadId() returns same thread id. #40386

Description

@burakkoken

go 1.13

When I create more than one go routine and use the calling of windows.GetCurrentThreadId function in their function body, it returns same thread id. Note: go routine body contains time.Sleep() not to be stop its execution immeditately. I mean all go routines are still executed.

go func() {
   threadId := windows.GetCurrentThreadId()
   log.Print(fmt.Sprintf("Go Routine 1 : %d", threadId ))
   time.Sleep(10E9)
}()
...
go func() {
   threadId := windows.GetCurrentThreadId()
   log.Print(fmt.Sprintf("Go Routine 10 : %d", threadId ))
   time.Sleep(10E9)
}()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions