[semaphore]

semaphore is a core slot, one of the keywords of the Hyperlambda language, in Hyperlambda, the language of Magic Cloud. Serializes access to a critical section by name; only one thread at a time can enter a given semaphore.

  • Value (semaphore-name), required: Semaphore name used to serialize access
  • Scope: provides semaphore

Arguments

Required arguments come first, then the optional ones in the order they are declared.

Argument Type Required Description
any node name lambda yes Executable child lambda object evaluated while the named semaphore is held. Can be repeated.

Guide: How to use [semaphore]

JSON declaration

This is the complete declaration of semaphore, as the running system describes it. It is also published as slot.json.

JSON declaration
{
  "name": "semaphore",
  "description": "Serializes access to a critical section by name; only one thread at a time can enter a given semaphore",
  "signature": {
    "input": {
      "kind": "semaphore-name",
      "description": "Semaphore name used to serialize access",
      "required": true,
      "mode": "ValueOrExpression"
    },
    "children": {
      "*": {
        "type": "lambda",
        "description": "Executable child lambda object evaluated while the named semaphore is held",
        "required": true,
        "mode": "ExecutableLambda",
        "cardinality": "OneOrMore",
        "role": "ExecutableBody",
        "evaluation": "EvalSelf",
        "projection": "Self"
      }
    },
    "scope": {
      "provides": "semaphore"
    }
  }
}

← return-value all core slots set-name →