File: testthreads.go

package info (click to toggle)
delve 1.26.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 15,084 kB
  • sloc: ansic: 111,947; sh: 194; asm: 147; makefile: 43; python: 23
file content (21 lines) | stat: -rw-r--r-- 248 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package main

import (
	"fmt"
	"sync"
)

func anotherthread(wg *sync.WaitGroup) {
	i := 1 * 5 / 39020
	fmt.Println(i)
	wg.Done()
}

func main() {
	var wg sync.WaitGroup
	for i := 0; i < 10; i++ {
		wg.Add(1)
		go anotherthread(&wg)
	}
	wg.Wait()
}