Await_kernel.SyncSourceAbstract implementation of bounded awaiting.
Operations which might need to synchronize with other threads for a bounded amount of time, eg to acquire a lock, take a Sync.t which provides an implementation of synchronization for them to use.
Usually, you should use the Sync.t provided by a parallelism or concurrency scheduler, but if you don't have one available you can use Sync_blocking.sync instead.
Represents the capability to block for a bounded amount of time.
val with_ :
'c ('r : value_or_null). yield:('c @ local -> Base.unit) Base.or_null @ local ->
sync:(#('c * Trigger.t Base.global) @ local -> Base.unit) @ local ->
'c @ local ->
f:(t @ local -> 'r @ local unique once forkable) @ local once ->
'r @ local unique once forkable @@ portablewith_ ~yield ~sync ctx ~f calls f with an implementation of synchronization such that sync ctx t trigger is its implementation of sync, and yield ctx t is its implementation of yield.
val create :
yield:('c @ local portable contended -> Base.unit) Base.or_null @ portable ->
sync:
(#('c Base.portended * Trigger.t Base.global) @ local -> Base.unit) @ portable ->
'c @ portable contended ->
t @@ portablecreate ~yield ~sync ctx is a new implementation of synchronization such that sync ctx t trigger is its implementation of sync, and yield ctx t is its implementation of yield.
yield t uses t to yield to the scheduler using the implementation of yielding associated with t.