1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        Keyway一個簡單的鎖庫

        聯(lián)合創(chuàng)作 · 2023-09-30 23:20

        A simple lock file library.

        Features
        • Provides mutual exclusion for scripts that require the same resource.

        • Requires three additional lines of code in your script, including sourcing the library.

        • Scripts using Keyway can be configured to either terminate or busy-wait if a resource is blocked.

        • Keyway will report when an external error was caught and there are lock files in the lock directory.

        Usage:
        • acquire_lock_for "your_task_name"

          • If the resource is not locked, your task will execute, otherwise it will terminate.

        • acquire_spinlock_for "your_task_name"

          • If the resource is locked, your task will wait until the lock has been released before acquiring its own lock and executing.

        Return Code Explanations:
        1. Your application was not able to acquire lock.

        2. There was some other problem:

        • Keyway could not create the lock directory.

        • Keyway could not create or remove a lock.

      2. An error was caught and there are lock files in the lock directory.

      3. An example:
        #!/bin/bash
        source keyway_lib.sh
        
        # optionally override the lock file directory
        LOCK_DIR="alt-lock-dir"
        
        # attempt to lock the shared resource
        acquire_lock_for "your_task_name"
        
        # if the lock was successful, execute the task
        echo "executing critical section"
        
        # release the lock when the task is done
        release_lock_for "your_task_name"

        GPRS_core_structure.png

        瀏覽 21
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        編輯 分享
        舉報
        評論
        圖片
        表情
        推薦
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        編輯 分享
        舉報
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            免费无码真人在线 | 91精品婷婷国产综合久久韩漫 | 成人视频在线观看视频 | 大力操逼| 韩日无码 | 夜夜高潮久久做爽久久 | 爱五月| 国产毛片子1区2区3区菊花影视 | 成人免费性爱网站 | 少妇菊爆在线播放 |