Skip to content

internal/race: add the package #8593

@dvyukov

Description

@dvyukov
We have a bunch of race-related copy-paste in sync, sync/atomic, net, syscall, runtime.
Moreover, any race-related functionality requires 2 files -- race.go and norace.go -- as
race functions are not provided by runtime in non-race build.

We can create internal/race package and move things like IsEnabled, Acquire, Release to
it. It will remove the copy-paste and all the additional files from other packages.

Additionally then we will be able to easily exclude or tune tests in race mode using
race.IsEnabled. E.g. now we have the cpuprof test that constantly flakes on
freebsd-amd64-race.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions