Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
d-kalinichenko committed Dec 10, 2024
1 parent c3ac35d commit acc7b59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions otherlibs/stdlib_alpha/capsule.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ end
external ( = ) : ('a[@local_opt]) -> ('a[@local_opt]) -> bool @@ portable = "%equal"

module Name : sig
type 'k t : value mod global portable many uncontended unique
type 'k t : value mod global portable many uncontended unique unyielding
type packed = P : 'k t -> packed

val make : unit -> packed @@ portable
Expand Down Expand Up @@ -87,7 +87,7 @@ module Password : sig

(* Can break the soundness of the API. *)
val unsafe_mk : 'k Name.t -> 'k t @@ portable
val name : 'k t @ local -> 'k Name.t @@ portable
val name : 'k t @ local yielding -> 'k Name.t @@ portable

module Shared : sig
(* CR layouts v5: this should have layout [void], but
Expand All @@ -96,10 +96,10 @@ module Password : sig

(* Can break the soundness of the API. *)
val unsafe_mk : 'k Name.t -> 'k t @@ portable
val name : 'k t @ local -> 'k Name.t @@ portable
val name : 'k t @ local yielding -> 'k Name.t @@ portable
end

val shared : 'k t @ local -> 'k Shared.t @ local @@ portable
val shared : 'k t @ local yielding -> 'k Shared.t @ local yielding @@ portable
end = struct
type 'k t = 'k Name.t

Expand Down
10 changes: 5 additions & 5 deletions otherlibs/stdlib_alpha/capsule.mli
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ module Password : sig
mutex. This guarantees that uncontended access to the capsule is
only granted to a single domain at once. *)

val name : 'k t @ local -> 'k Name.t @@ portable
val name : 'k t @ local yielding -> 'k Name.t @@ portable
(** [name t] identifies the capsule that [t] is associated with. *)

(** Shared passwords represent permission to get shared access to a capsule *)
Expand All @@ -119,12 +119,12 @@ module Password : sig
Obtaining a ['k t] requires read acquire the reader-writer lock
associate with ['k]. *)

val name : 'k t @ local -> 'k Name.t @@ portable
val name : 'k t @ local yielding -> 'k Name.t @@ portable
(** [name t] identifies the capsule that [t] is associated with. *)

end

val shared : 'k t @ local -> 'k Shared.t @ local @@ portable
val shared : 'k t @ local yielding -> 'k Shared.t @ local yielding @@ portable
(** [shared t] is a shared password for the same capsule as [t]. *)

end
Expand All @@ -139,7 +139,7 @@ val access :
[portable] and it is marked [contended]. *)

val access_shared :
'k Password.Shared.t @ local
'k Password.Shared.t @ local yielding
-> ('k Access.t @ shared -> 'a @ portable contended) @ local yielding portable
-> 'a @ contended
@@ portable
Expand All @@ -162,7 +162,7 @@ module Mutex : sig
Unpacking one provides a ['k Mutex.t] together with a fresh
existential type brand for ['k]. *)

val name : 'k t @ local -> 'k Name.t @@ portable
val name : 'k t @ local yielding -> 'k Name.t @@ portable
(** [name m] identifies the capsule that [m] is associated with. *)

exception Poisoned
Expand Down

0 comments on commit acc7b59

Please sign in to comment.