Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-2443

QSystemSemaphore: add bool tryAcquire(int timeout)

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 4.4.0
    • Fix Version/s: Some future release
    • Component/s: Core: Threads
    • Labels:
      None

      Description

      As documented, QSystemSemaphore::acquire() always blocks the call, if all the resources have already been acquired, until some another process release resource. And there is no way nor to know a number of available resources, nor to try to acquire resources without blocking the call. At the same time QSemaphore have both tryAcquire(...) and available().

      This makes QSystemSemaphore unusable for some purposes and one needs to write an own almost-the-same semaphore. So it would be nice adding "bool QSystemSemaphore::tryAcquire(int timeout)" to the public API.

      Also, "src/corelib/kernel/qsystemsemaphore_unix.cpp:233" outputs "SystemSempahore" instead of "SystemSemaphore".

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              cnn Qt Core & Network
              Reporter:
              admin Administrator
              Votes:
              24 Vote for this issue
              Watchers:
              21 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes