package core_kernel

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file thread_pool_cpu_affinity.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
open! Core_kernel
open! Import

module Cpuset = struct
  include Validated.Make (struct
      type t = Int.Set.t [@@deriving sexp]

      let here = [%here]

      let validate t =
        Validate.first_failure
          (Int.validate_lbound ~min:(Incl 1) (Int.Set.length t))
          (Int.Set.to_list t
           |> List.map ~f:Int.validate_non_negative
           |> Validate.name_list "Thread_pool_cpuset")
      ;;
    end)

  let equal t1 t2 = Int.Set.equal (t1 |> raw) (t2 |> raw)
end

type t =
  | Inherit
  | Cpuset of Cpuset.t
[@@deriving sexp]