package jsonrpc2

import (
	"sync"
)

var (
	idCounter int
	idMu      sync.Mutex
)

func nextID() int {
	idMu.Lock()
	defer idMu.Unlock()

	idCounter++
	if idCounter < 0 {
		idCounter = 1
	}
	return idCounter
}
